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
Why isn't it being handled properly?
Why can’t constant values be used to define an array’s initial size?
What is the size of structure in c?
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
What is meant by errors and debugging?
What is difference between structure and union?
What is the advantage of c?
Is python a c language?
Is there any data type in c with variable size?
How can I generate floating-point random numbers?
Write a C program to count the number of email on text
What is header file in c?
How can you find the day of the week given the date?
What is wrong with this code?
where are auto variables stored? What are the characteristics of an auto variable?