In this program we declare 4 type of variables which is integer , float , double , char. hten we find the size of variables using size of operator.
1. Program to find the size of variables in c language.
#include<stdio.h>
#include<conio.h>
void main()
{
int int_type;
float float_type;
double double_type;
char char_type;
clrscr();
//size of operator is used to find the value of variables
printf("Integer size is%d byte\n",sizeof(int_type));
printf("Float size is%f byte\n",sizeof(float_type));
printf("Double size is %ld byte\n",sizeof(double_type));
printf("Integer size is%c byte\n",sizeof(char_type));
1. Program to find the size of variables in c language.
#include<stdio.h>
#include<conio.h>
void main()
{
int int_type;
float float_type;
double double_type;
char char_type;
clrscr();
//size of operator is used to find the value of variables
printf("Integer size is%d byte\n",sizeof(int_type));
printf("Float size is%f byte\n",sizeof(float_type));
printf("Double size is %ld byte\n",sizeof(double_type));
printf("Integer size is%c byte\n",sizeof(char_type));