If 3.14f mentioned like 3.14 then it will be assumed as double. So answer will be 8.
Srivibha said:
(Wed, Nov 3, 2010 10:06:14 PM)
It prints 1 1 4 in turbo c++ compiler.
Mantosh Tiwari said:
(Fri, Nov 12, 2010 04:49:12 AM)
There are given that the int is of size 4 bytes so it will print 1 4 4 ..
Hitesh Bhateja said:
(Wed, Jan 19, 2011 05:19:52 PM)
@SRIVIBHA,
I agree with you..
sizeof('A') returns 1 byte because A is character not integer so it always returns character value.
Sajal said:
(Tue, Sep 13, 2011 10:25:26 PM)
Please explain the reason.
Sattibabu said:
(Fri, Nov 11, 2011 06:34:27 PM)
sizeof(A)=size of(65)=sizeof(int)=2bytes
Neeraj said:
(Wed, Mar 7, 2012 05:58:16 PM)
sizeof('A')=it will always return 1 since there can be only 1 character in single quotes '' and the size of char is 1 bytes.
sizeof("A")=it will return 2 bytes there are 2 characters in it (A and \0)as the compiler inserts the null character automatically.
Bala said:
(Sun, Jul 8, 2012 05:47:47 PM)
@Neeraj:
How come sizeof('as') return 2 bytes? In single quote can ther be two characters?
Yogesh said:
(Tue, Oct 2, 2012 11:53:33 PM)
In single quotation there can be only character. Correct. Ok then sizeof ('A') will be simply sizeof (char). So it will definitely return 1 byte. Obviously.