C Program to find the size of int float double and char

Write a C program to find the size of int or integer, float, double, and char or character with an example. In C programming, we have a sizeof operator which allows us to print or get the size of any data type.

#include <stdio.h>

int main()
{   
    printf("Size of a Character = %ld Byte", sizeof(char));

    printf("\nSize of an Integer  = %ld Byte", sizeof(int));

	printf("\nSize of a Float     = %ld Byte", sizeof(float));

	printf("\nSize of a Double    = %ld Byte\n", sizeof(double));

    return 0;
}
C Program to find the size of int float double and char

About Suresh

Suresh is the founder of TutorialGateway and a freelance software developer. He specialized in Designing and Developing Windows and Web applications. The experience he gained in Programming and BI integration, and reporting tools translates into this blog. You can find him on Facebook or Twitter.