sizeof() function

#include <stdio.h> int main() { int integerType; float floatType; double doubleType; char charType; // Sizeof operator is used to evaluate the size of a data type printf("Size of int: %ld bytes\n",sizeof(int)); printf("Size of float: %ld bytes\n",sizeof(float)); printf("Size of double: %ld bytes\n",sizeof(double)); printf("Size of char: %ld byte\n",sizeof(char)); // Sizeof operator is used to evaluate the size of a variable printf("Size of int: %ld bytes\n",sizeof(integerType)); printf("Size of float: %ld bytes\n",sizeof(floatType)); printf("Size of double: %ld bytes\n",sizeof(doubleType)); printf("Size of char: %ld byte\n",sizeof(charType)); return 0; }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.