Predict the output or error(s) for the following:
25. main()
{
printf("%p",main);
}

Answers were Sorted based on User's Feedback



Predict the output or error(s) for the following: 25. main() { printf("%p",main); } ..

Answer / surenda pal singh chouhan

Some address will be printed.

Explanation:
Function names are just addresses (just like
array names are addresses).
main() is also a function. So the address of function main
will be printed. %p in printf specifies that the argument
is an address. They are printed as hexadecimal numbers.

26. main()

Is This Answer Correct ?    28 Yes 2 No

Predict the output or error(s) for the following: 25. main() { printf("%p",main); } ..

Answer / khushboo

i tried it out.. on my system it gives the answer 0291. does
anybodyy esle gets the same answer?

Is This Answer Correct ?    12 Yes 2 No

Predict the output or error(s) for the following: 25. main() { printf("%p",main); } ..

Answer / sandeep

Yaaa Even i got the output as 0291

Is This Answer Correct ?    5 Yes 2 No

Post New Answer

More C Interview Questions

What is keyword in c?

0 Answers  


which one is not preprocessor directive a)#if b)#elif c)#undef d)#pragma

16 Answers   Accenture, Infosys, TCS, Wipro,


How many keywords are there in c?

0 Answers  


Difference between exit() and _exit() function?

0 Answers  


How can I check whether a file exists? I want to warn the user if a requested input file is missing.

0 Answers  






64/square(4)

1 Answers  


what would be the output of the following program? main() { int k = 123; char *ptr; ptr = &k; printf("%d",*ptr); }

4 Answers  


What does void main return?

0 Answers  


what is the mean of c languages.

1 Answers   Polaris,


How we can set and clear bit in a byte using macro function?

2 Answers   L&T, Samsung,


How to run c Program without using IDE of c. means if program made in notepad.then how to compile by command prompt.

1 Answers   HP, TCS,


What is the difference between array and structure in c?

0 Answers  


Categories