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 wrong with this program statement? void = 10;
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
What is a good way to implement complex numbers in c?
List some basic data types in c?
What should malloc() do? Return a null pointer or a pointer to 0 bytes?
What is the scope of static variable in c?
Discuss the function of conditional operator, size of operator and comma operator with examples.
What is the general form of function in c?
What is FIFO?
Which is more efficient, a switch statement or an if else chain?
What the different types of arrays in c?
What is the return type of sizeof?
What is call by reference in functions?
Explain what is the benefit of using enum to declare a constant?
How would you obtain the current time and difference between two times?