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

Answer Posted / deepali chandra

o/p 1 2 2
sizeof('3')takes 3 as character and so, size of a character
is 1 byte

sizeof("3") takes 3 as a string so, one
character 3 and end character '\0'. so, sizeof("3") gives
o/p 2

and
sizeof(3) takes 3 as integer so size of an integer is 2
bytes

Is This Answer Correct ?    17 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are the variables argc and argv are local to main?

793


What is size of union in c?

584


What is else if ladder?

614


Explain what is a program flowchart and explain how does it help in writing a program?

653


write a program to find out prime number using sieve case?

1646






What are the differences between Structures and Arrays?

614


Define macros.

787


What is meant by operator precedence?

680


What is graph in c?

587


What is hash table in c?

576


Explain what is wrong with this statement? Myname = ?robin?;

1043


What are the various types of control structures in programming?

631


a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list

638


What is s in c?

622


hi send me sample aptitude papers of cts?

1656