When a while Loop Terminates - C Statement

C examples for Statement:while

Description

When a while Loop Terminates

Demo Code

#include <stdio.h>
int main(void)
{
    int n = 5;//from w w  w.jav a  2 s .c  o  m
    
    while (n < 7)       
    {
        printf("n = %d\n", n);
        n++;            
        printf("Now n = %d\n", n);   
    }
    printf("done.\n");
    
    return 0;
}

Result


Related Tutorials