write a program that prints the value of sizeof (int), sizeof (short), sizeof (long), sizeof(float), sizeof (double) and sizeof (long double).
write a

Program to print the sizeof integer type, short type, long type, float type, double type and long double type of variables.
#include<stdio.h>
int main() {
int int_Type;
short short_Type;
long long_Type;
float float_Type;
double double_Type;
long double longdouble_Type;
// sizeof computes the size of a variable
printf("Size of int: %ld bytes\n", sizeof(int_Type));
printf("Size of short: %ld byte\n", sizeof(short_Type));
printf("Size of long: %ld byte\n", sizeof(long_Type));
printf("Size of float: %ld bytes\n", sizeof(float_Type));
printf("Size of double: %ld bytes\n", sizeof(double_Type));
printf("Size of long double: %ld byte\n", sizeof(longdouble_Type));
return 0;
}
Step by step
Solved in 3 steps with 1 images









