What will the following programs print in while and do while loop? - C Statement

C examples for Statement:do while

Description

What will the following programs print in while and do while loop?

Demo Code

#include <stdio.h> 

int main(void) 
{ 
    int i = 0; //from w w w.  j  a va  2  s . c  o  m
 
    while (++i < 4) 
       printf("Hi! "); 
    
    do 
       printf("Bye! "); 
    while (i++ < 8); 
    
    return 0; 
}

Result


Related Tutorials