Q. What is the output of the following C program?
Code:#include <stdio.h>
int main()
{
int main = 9;
printf("%d", main);
return 0;
}
β
Correct Answer: (C)
It will run without error and displays 9
Explanation: In a C program, you may encounter the same name of a function and the same name of a variable. The program will display:
$gcc prog3.c
$ a.out
9
$gcc prog3.c
$ a.out
9