main()
{
printf("\n %d %d %d",sizeof('3'),sizeof("3"),sizeof(3));
}
Answer Posted / karen
It is theoretically possible for the answer to vary
depending on characteristics of the system. This is why it
is always best to use sizeof instead of assuming the size
of a datatype. This line is equivalent to:
printf("\n %d %d %d",sizeof(char),sizeof(char[2]),sizeof
(int));
The middle is char[2] because it contains 3 and \0.
On my x86 windows 7 system, this program outputs 1 2 4.
Your numbers may be different due to system architecture
differences.
| Is This Answer Correct ? | 12 Yes | 2 No |
Post New Answer View All Answers
What are the advantages of using macro in c language?
What is struct node in c?
Explain the Difference between the New and Malloc keyword.
Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result
Why do we use int main?
Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)
What is a pointer in c plus plus?
In c programming, explain how do you insert quote characters (? And ?) Into the output screen?
What is an operator?
What is logical error?
How can I split up a string into whitespace-separated fields?
Explain enumerated types.
Differentiate between full, complete & perfect binary trees.
Why can’t we compare structures?
Can we assign string to char pointer?