sizeof operator program

 Program:

#include<stdio.h>
#include<conio.h>
void main()
{
    int n;
    char ch;
    float ft;
    double db;
    clrscr();
    printf("Size of int is : %d Bytes", sizeof(n) );
    printf("\nSize of char is : %d Bytes", sizeof(ch) );
    printf("\nSize of float is : %d Bytes", sizeof(ft) );
    printf("\nSize of double is : %d Bytes", sizeof(db) );
    getch();
}

Output:

Size of int is : 2 Bytes
Size of char is : 1 Bytes
Size of float is : 4 Bytes
Size of double is : 8 Bytes


Next Topic        :  Type casting (or) Type conversion

Previous Topic :  Comma Operator Program

No comments:

Post a Comment