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


Please Help Members By Posting Answers For Below Questions

ATM machine and railway reservation class/object diagram

4805


Explain low-order bytes.

623


What is the difference between single charater constant and string constant?

623


What is bash c?

556


Here is a neat trick for checking whether two strings are equal

566






What is difference between constant pointer and constant variable?

630


Is c dynamically typed?

667


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?

603


How variables are declared in c?

571


What are structure types in C?

669


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?

780


What is a structure member in c?

548


What is typedf?

670


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

2555


What is the best way to store flag values in a program?

580