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();
}

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

    1. Admin Post author

      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.

      Reply
  1. akaashghai

    write a program to print the size of all the datatypes supported by c and its range

    Reply

Leave a Reply

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