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 ? | 70 Yes | 17 No |
Post New Answer View All Answers
ATM machine and railway reservation class/object diagram
Explain low-order bytes.
What is the difference between single charater constant and string constant?
What is bash c?
Here is a neat trick for checking whether two strings are equal
What is difference between constant pointer and constant variable?
Is c dynamically typed?
Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?
How variables are declared in c?
What are structure types in C?
If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?
What is a structure member in c?
What is typedf?
Write a C program to help a HiFi’s Restaurant automate its breakfast billing system. Your assignment should implement the following items: a. Show the customer the different breakfast items offered by the HiFi’s Restaurant. b. Allow the customer to select more than one item from the menu. c. Calculate and print the bill to the customer. d. Produce a report to present your complete program and show more sample output. Assume that the HiFi’s Restaurant offers the following breakfast menu: Plain Egg $2.50 Bacon and Egg $3.45 Muffin $2.20 French Toast $2.95 Fruit Basket $3.45 Cereal $0.70 Coffee $1.50 Tea $1.80
What is the best way to store flag values in a program?