C Program : Sizeof() operator main
#include <stdio.h>
int main() { int integerVar; double doubleVar; char charVar; float floatVar; printf("Size of int: %zu bytes\n", sizeof(int)); printf("Size of double: %zu bytes\n", sizeof(double)); printf("Size of char: %zu bytes\n", sizeof(char)); printf("Size of float: %zu bytes\n", sizeof(float)); printf("Size of integerVar: %zu bytes\n", sizeof(integerVar)); printf("Size of doubleVar: %zu bytes\n", sizeof(doubleVar)); printf("Size of charVar: %zu bytes\n", sizeof(charVar)); printf("Size of floatVar: %zu bytes\n", sizeof(floatVar)); return 0; }
Comments
Post a Comment