What would the output of c program

#include <stdlib.h>
#include <stdio.h>
enum {false, true};
int main()
{
int i = 1;
do
{
printf(“%d\n”, i);
i++;
if (i < 15)
continue;
} while (false);

getchar();
return 0;
}

Asked on January 31, 2020 in program.
Add Comment
1 Answer(s)

Output: 1

Explanation:

The do wile loop checks condition after each iteration. So after continue statement, control transfers to the statement while(false). Since the condition is false ‘i’ is printed only once.

Answered on January 31, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.