main()
{
printf("\n %d %d %d",sizeof('3'),sizeof("3"),sizeof(3));
}
wat is the o/p and how?

Answer Posted / deepali chandra

o/p 1 2 2
sizeof('3')takes 3 as character and so, size of a character
is 1 byte

sizeof("3") takes 3 as a string so, one
character 3 and end character '\0'. so, sizeof("3") gives
o/p 2

and
sizeof(3) takes 3 as integer so size of an integer is 2
bytes

Is This Answer Correct ?    17 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the mean of function?

837


write a c programming using command line argument,demonstrate set operation(eg;union,intersection,difference) example output is c:>setop 12 34 45 1 union 34 42 66 c:>setop 12 34 1 42 66 c:>setop 12 34 diff 12 56 67 78 setop 12 34

1837


How can I send mail from within a c program?

766


Explain what are the different data types in c?

930


Write a code to determine the total number of stops an elevator would take to serve N number of people.

969


How many levels of pointers can you have?

913


How can I write a function analogous to scanf?

871


When a c file is executed there are many files that are automatically opened what are they files?

798


In which header file is the null macro defined?

1099


Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon

1961


What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?

1000


What is null character in c?

855


Explain what is the use of a semicolon (;) at the end of every program statement?

942


A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.

1444


Write a program to check palindrome number in c programming?

771