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
What is mean by data types in c?
Write a program to check armstrong number in c?
Combinations of fibanocci prime series
What is the difference between local variable and global variable in c?
How does sizeof know array size?
What is the difference between null pointer and wild pointer?
What are the scope of static variables?
How are portions of a program disabled in demo versions?
What are the different categories of functions in c?
Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?
What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?
What is function pointer c?
What are the types of c language?
Explain how are portions of a program disabled in demo versions?
which is conditional construct a) if statement b) switch statement c) while/for d) goto