Multiple choice technology programming languages

#include int main() { int main=7; printf("%d",main); }

  1. 777777.........

  2. Compilation Error

  3. 7

  4. None of the above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

In C, it is legal to declare a local variable with the name main inside the main function. This local variable shadows the outer function name. Thus, printf prints the integer value 7. It compile successfully and does not cause infinite recursion or compiler errors.