main()
{
printf("\n %d %d %d",sizeof('3'),sizeof("3"),sizeof(3));
}
Answers were Sorted based on User's Feedback
Answer / 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 |
'3' is a character so it take 1 byte
"3" is a string containing 2 characters 3 and \0 so it takes
2bytes
3 is a integer and it takes 4 bytes
so answer is 1 2 4
| Is This Answer Correct ? | 15 Yes | 6 No |
Answer / manish soni bca 3rd year jaipu
#include<stdio.h>
#include<conio.h>
void main()
{
printf("%d %d %d",sizeof('3'),sizeof("3"),sizeof
(3));
getch();
}
answer is:-
1 2 2
on Turbo C++ 4.5 on win base at win 7
| Is This Answer Correct ? | 10 Yes | 2 No |
Answer / hemachandar
the first ('3') value goes to char., so it takes 1.
then for second ("3") value takes the string., string value takes 2.
for third (3), its int., so it takes the value of 2.
Every printf takes the values from right to left, so it takes the output as 2 2 1.
Simple!!!
| Is This Answer Correct ? | 1 Yes | 1 No |
how does the for loop work actually..suppose for the following program how it ll work plz explain to me for(i=5;i>=0;i--) prinf(i--);
What is a function in c?
how does printf function work
Is fortran faster than c?
write a c program to calculate sum of digits till it reduces to a single digit using recursion
Difference between C and Embedded C?
Where static variables are stored in memory in c?
hi how to convert program from notepad to turboc editor can u please help me
my name is nani i completed my b-tech in hyd now i want go for interveiw but i dont know the process of software field interveiws plz help me anyone how many rouds there n what rounds plz plz plz help me n where i can get these details
what is an array
. Explain the differences between fork() and exec() in C
the expression a=30*1000+2768; evalutes to a) 32768 b) -32768 c) 113040 d) 0