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
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
Is fortran faster than c?
How many header files are in c?
Are pointers integers in c?
the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above
Why we use void main in c?
write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list
What do you understand by normalization of pointers?
Is it better to use malloc() or calloc()?
c language interview questions & answer
What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.
Explain the difference between exit() and _exit() function?
Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.
Why doesnt long int work?
Why do we use & in c?