C : Storage Class

What is the output of the following code?

main()
{
static int num=8;
printf(“%d ”,num=num-2);
if(num!=0) main();
}
,

What is the output of the following code?

main()
{
static int num=8;
printf(“%d ”,num=num-2);
if(num!=0) main();
}

What is the output of the following code?

main()
{
static int num=8;
printf(“%d ”,num=num-2);
if(num!=0) main();
}

What is the output of the following code?

main()
{
static int num=8;
printf(“%d ”,num=num-2);
if(num!=0) main();
}

A. 8 6 4 2

B. Infinite output

C. 6 4 2 0

D. Invalid because main function can’t call itself.



Correct Answer :

C. 6 4 2 0



Latest Current Affairs 2026 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test , CCC MCQ Python Coding Tutorials Best Computer Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Website development Company in Allahabad