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

Answer Posted / ashwin

4 2 4

sizeof('3') means it will take ascii value which is an
integer, it shows size of integer.

sizeof("3") means, here it will treat it as an array, it
will print size of an array, so array contain '3' and '\0'
so out put is 2.

try size("3ashwin") it will give 8 as out put.

sizeof(3) means directly we asking size of an integer.

thank you

if is an wrong answer plz write correct answer to

molugu.ashwin@gamil.com

Is This Answer Correct ?    71 Yes 17 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why isn't it being handled properly?

825


Why can’t constant values be used to define an array’s initial size?

1078


What is the size of structure in c?

888


what is the c source code for the below output? 10 10 10 10 10 10 10 10 10 10 9 9 7 6 6 6 6 6 6 9 7 5 9 7 3 2 2 5 9 7 3 1 5 9 7 3 5 9 7 4 4 4 4 5 9 7 8 8 8 8 8 8 8 8 9

1616


What is meant by errors and debugging?

839


What is difference between structure and union?

844


What is the advantage of c?

785


Is python a c language?

755


Is there any data type in c with variable size?

843


How can I generate floating-point random numbers?

786


Write a C program to count the number of email on text

1626


What is header file in c?

823


How can you find the day of the week given the date?

828


What is wrong with this code?

883


where are auto variables stored? What are the characteristics of an auto variable?

820