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

What are qualifiers in c?

574


What is structure padding and packing in c?

621


Explain how do you list a file’s date and time?

619


"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above

615


What 'lex' does?

717






Why is c platform dependent?

623


What's the right way to use errno?

624


What is ponter?

772


What are the key features in c programming language?

615


Where define directive used?

607


i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical

1844


What are the types of data structures in c?

600


How many types of sorting are there in c?

612


What is d scanf?

595


What does c value mean?

628