Ex.No:2c Display the size of each data type

AIM:

          To write a c program to display the size of each data type.

ALGORITHM:

Step 1: Start the program.

Step 2: Use the “sizeof()” operator to display the size of each datatype.

Step 3 : Print the Fahrenheit value.

Step 4: Stop the program.

PROGRAM CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
    double a;
    clrscr();
    printf("nSize of different datatypes in C");
    printf("n--------------------------------");
    printf("nSize of Integer : %d bytes",sizeof(int));
    printf("nSize of Long : %d bytes",sizeof(long));
    printf("nSize of Float : %d bytes",sizeof(float));
    printf("nSize of Double : %d bytes",sizeof(a));
    printf("nSize of Character : %d byte",sizeof(char));
    printf("nSize of Unsigned Integer : %d bytes",sizeof(unsigned int));
    getch();
}
OUTPUT:

sizeof

RESULT:

                    Thus the c program to display the size of each data type is written and executed successfully.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *