Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » BeginnersRSS Feeds

Program to print size of int, float and double using sizeof()

Posted By: Lacey Hughes     Category: C Programming     Views: 4537

Program to print size of int, float and double using sizeof().

Code for Program to print size of int, float and double using sizeof() in C Programming

#include<stdio.h>
#include<conio.h>

int main()
{
    clrscr();

    printf("Size of int is -> %d\n",sizeof(int));

    printf("Size of long is -> %d\n",sizeof(float));

    printf("Size of double is -> %d\n",sizeof(double));

    getch();

    return 0;
}



Output:


Size of intis -> 2
Size of longis -> 4
Size of doubleis -> 8
  
Share: 



Lacey Hughes
Lacey Hughes author of Program to print size of int, float and double using sizeof() is from London, United Kingdom.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!