Solved programming problem

Program to find size of int, float, double and char of the system in C.

Source code

#include <stdio.h>

int main()

{

    int int_var;

    char char_var;

    float  float_var;

    double double_var;

    ///finding size with sizeof function and print them

    printf("
Size of Integer is = %d bytes
",sizeof(int_var));

    printf("Size of Character is = %d bytes
",sizeof(char_var));

    printf("Size of Float is = %d bytes
",sizeof(float_var));

    printf("Size of Double is = %d bytes
",sizeof(double_var));

    return 0;

}

Output

Size of Integer is = 4 bytes

Size of Character is = 1 bytes

Size of Float is = 4 bytes

Size of Double is = 8 bytes

Join the discussion

Add your comment