main()
{
printf("\n %d %d %d",sizeof('3'),sizeof("3"),sizeof(3));
}
wat is the o/p and how?

Answer Posted / k.thanigaivel

This output is
4 2 4

Explanation:
sizeof('1 or 2 or 3,......or n')=4

sizeof("0")=2
sizeof("10")=3
sizeof("100")=4
sizeof("1000")=5
sizeof("10000")=6
.
.
.
.
.
sizeof("n")=n

sizeof(1 or 2 or 3......or n)=4

Is This Answer Correct ?    27 Yes 25 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you pass an array to a function by value?

608


What is pragma in c?

633


How can I remove the trailing spaces from a string?

618


Why do we use int main?

617


Does c have enums?

604






the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function

764


Can include files be nested?

631


Is sizeof a keyword in c?

586


What is structure padding and packing in c?

627


int i=3; this declaration tells the C compiler to a) reserve space in memory to hold the integer value b) associate the name i with this memory location c) store the value 3 at this location d) all the above

758


Why c language is called c?

573


What is NULL pointer?

680


Why is c still so popular?

620


What are the storage classes in C?

629


How can I handle floating-point exceptions gracefully?

636