DO NOT MISS

Ads

Friday 15 July 2016

C-Programs Using Special Operators


* Write a Program to print find the sizeof the int data type.

#include<stdio.h>
#include<conio.h>

void main()

      {

           int x;
           clrscr();

           
printf(“integer size=%d”,sizeof(x));

           getch();

      }

Output:-

integer size=2

* Write a Program to print find the sizeof the all data types.

#include<stdio.h>
#include<conio.h>

void main()

      {

             int a;
             float b;
             char c;
             double d;
             clrscr();

                  printf(“integer size=%d\n”,sizeof(a));
                  printf(“float size=%d\n”,sizeof(b));
                  printf(“char size=%d\n”,sizeof(c));
                  printf(“double size=%d\n”,sizeof(d));

             getch();

      }

Output:-

integer size=2
float size=4
char size =1
double size=8
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________

Greataims

 
Copyright © 2016 Computersadda. Designed by @ Computersadda Team - Published By Greataims