Question discussion

Determine Output:void main(){ printf("%p", main);}

302558Medium 1 reply 618 views
2
Determine Output:void main(){ printf("%p", main);}
  • AError
  • Bmake an infinite loop
  • CSome address will be printed
  • DNone of These
Correct answer: C

Discussion 1

0
CCommunity
Some address will be printed

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.