Discussion :: C-MCQs
-
What will happen if the below program is executed?
int main()
{
int main = 3;
printf("%d", main);
return 0;
}
A.
It will cause a compile-time error
|
B.
It will cause a run-time error
|
C.
It will run without any error and prints 3
|
D.
It will experience infinite looping
|
Answer : Option C
Explanation :
A C program can have same function name and same variable name.
$ cc pgm3.c
$ a.out
3
Be The First To Comment