write a program to find the size of different data types available in c
Write a c program to find the size of int float double and char
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
printf("Integer takes %d bytes\n",sizeof(int));
printf("Floating-point takes %d bytes\n",sizeof(float));
printf("Character takes %d byte\n",sizeof(char));
printf("Double takes %d bytes\n",sizeof(double));
getch();
}
Output:
Integer takes 2 bytes
Floating-point takes 4 bytes
Character takes 1 byte
Double takes 8 bytes
Write a c program to find the size of int float double and char
Reviewed by Vision Academy
on
December 14, 2021
Rating:
No comments: