Sail E0 Webinar
Question


Which of the following statements are correct about the program?


#include<stdio.h>
int main()
{
printf("%p\n", main());
return 0;
}
Options:
A .  It prints garbage values infinitely
B .  Runs infinitely without printing anything
C .  Error: main() cannot be called inside printf()
D .  No Error and print nothing
Answer: Option B

In printf("%p`setminus`n", main()); it calls the main() function and then it repeats infinetly,

 untill stack overflow.




Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers