QUIZ 62

What is the output ?

int main()
{
static int i=5;
if(i>0)
printf(“%d”,i–);
else;
main();
return 0;
}

a) 5
b) 5 4 3 2 1
c) Syntactical Error
d) Runtime Error

Answer : (c)

Explanation :

No terminating condition for recursive call of main function, So, runtime error occurs due to infinite recursive call to main().

Leave a Reply

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