/*Program to print the size of int,float and double variables Program No : 24 of GTU Practice Programs Developed by : Malhar Vora Developed on : 20/07/2010 Email : vbmade2000@gmail.com Web Site : http://malhar2010.blogspot.com ****************************************************************************/ #includevoid main() { int i=1; float f=2.5; double d=2.60; printf("Size of int is %d",sizeof(i)); printf("\nSize of int is %d",sizeof(f)); printf("\nSize of int is %d",sizeof(d)); }
Thursday, July 22, 2010
Program to display size of int,float and double variables ( GTU Sem I Program No : 24)
Subscribe to:
Post Comments (Atom)
I used to think that "sizeof()" was a function when I started learning C/C++. Actually sizeof() is an operator just like + - * / % etc.
ReplyDeleteAlso, below two lines are same. (That's parenthesis is not compulsory. But some few compilers must need parenthesis)
1. sizeof(int);
2. sizeof int;
First of all I am very much thankful as You noticed My Blog [Malhar2010]. You are the First who has commented on my Blog.
ReplyDeleteYa, absolutely, sizeof is an operator but it is misunderstood due to use of ().
So, You have also given me additional Knowledge on it, as I wasn't knowing that actually. So I appreciate your comment. Thanks.
how do you compile it (not a c programmer, but want to run the job.
ReplyDelete