Sunday, August 15, 2021

Data Types in C

 #include <stdio.h>      
int main() {
  short a;
  long b;
  long long c;
  long double d;

  printf("size of short = %d bytes\n", sizeof(a));
  printf("size of long = %d bytes\n", sizeof(b));
  printf("size of long long = %d bytes\n", sizeof(c));
  printf("size of long double= %d bytes\n", sizeof(d));
  return 0;

OUTPUT 

size of short = 2 bytes
size of long = 8 bytes
size of long long = 8 bytes
size of long double= 16 bytes

No comments:

Post a Comment