adplus-dvertising
frame-decoration

Question

What is the output of this program?

#include <stdio.h>
void main()
{
    int a = 3;
    while (a--)
    {
        int a = 10;
        a--;
        printf("%d ", a);
    }
}

a.

9 9 9

b.

9 8 7

c.

2 1 0

d.

Infinite loop

Posted under C Programming

Answer: (a).9 9 9

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?