11-Write a C program to calculate the size of data type.

Program: 11

Write a C program to calculate the size of data type.

#include
#include
void main()
{
    int a, b, c, d;
    a=sizeof(int);
    b=sizeof(float);
    c=sizeof(char);
    d=sizeof(double);
    printf("Size of integer is: %d\n", a);
    printf("Size of float is: %d\n", b);
    printf("Size of char is: %d\n", c);
    printf("Size of double is: %d", d);
    getch();
}
Output
Size of integer is: 4

Size of float is: 4

Size of char is: 1

Size of double is: 8

Lokesh Kumar: Being EASTER SCIENCE's founder, Lokesh Kumar wants to share his knowledge and ideas. His motive is "We assist you to choose the best", He believes in different thinking.
Related Post
Leave a Comment

This website uses cookies.