Sizeof Function

#include<stdio.h>
/*
Sizeof function @kodingkeys@keycomputer
*/
int main()
{
int i;
float f;
double d;
char c;

// Sizeof operator is used to evaluate the size of a variable
printf(“Size of int: %ld bytes\n”,sizeof(i));
printf(“Size of float: %ld bytes\n”,sizeof(f));
printf(“Size of double: %ld bytes\n”,sizeof(d));
printf(“Size of char: %ld byte\n”,sizeof(c));

return 0;
}

Output:
Size of int: 4 bytes
Size of float: 4 bytes
Size of double: 8 bytes
Size of char: 1 byte

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s