C program to print size of different data types

C program to print size of different data types

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

void main()
{
clrscr();
printf(“TypettttSize (bytes)”);
printf(“nCharacterttt    %d”,sizeof(char));
printf(“nIntegertttt    %d”,sizeof(int));
printf(“nLong intttt    %d”,sizeof(long int));
printf(“nFloattttt    %d”,sizeof(float));
printf(“nDoubletttt    %d”,sizeof(double));
printf(“nLong doublettt    %d”,sizeof(long double));
getch();
}

4 thoughts on “C program to print size of different data types”

    1. Actually here we are printing the size of data type and size will be an integer value. To print an integer value we use %d, I hope it will clear your confusion.

Leave a Comment

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