What will be the output of the following C code?
#include <stdio.h>
void main()
{
register int x = 0;
if (x < 2)
{
x++;
main();
}
}
#include <stdio.h>
void main()
{
register int x = 0;
if (x < 2)
{
x++;
main();
}
}A. Segmentation fault
B. main is called twice
C. main is called once
D. main is called thrice
Answer: Option A

Join The Discussion