Open In App

C | Operators | Question 27

Predict the output of following C program 




#include <stdio.h>
int main()
{
    int i = 0;
    do
    {
        printf(\"GeeqsQuiz \");
        i = i++;
    }
    while (i < 5);
    return 0;
}

(A)



GeeqsQuiz GeeqsQuiz GeeqsQuiz GeeqsQuiz GeeqsQuiz

(B)



Infinite time GeeksQuiz

(C)

Undefined Behavior

(D)

None of the above


Answer: (C)
Explanation:

The below statement causes undefined behavior.

 i = i++;

Quiz of this Question
Please comment below if you find anything wrong in the above post

Article Tags :