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

Answer Posted / vinay kabra

Answer is : 1 2 2
because

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

sizeof("3") takes 3 as a string so, here strinf contains 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 ?    18 Yes 24 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is null always equal to 0(zero)?

589


what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555

2539


Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?

1602


Why we use void main in c?

600


Write a program to print fibonacci series using recursion?

591






What is a structure in c language. how to initialise a structure in c?

611


In a header file whether functions are declared or defined?

632


What is the right way to use errno?

625


What is #define in c?

624


Explain the concept and use of type void.

632


Explain how to reverse singly link list.

611


How can I dynamically allocate arrays?

600


Where in memory are my variables stored?

639


write a program fibonacci series and palindrome program in c

633


Is Exception handling possible in c language?

1588