Use int type value to control while loop - C Statement

C examples for Statement:while

Description

Use int type value to control while loop

Demo Code

#include <stdio.h>

#define MAX 100/*from  w  w w .  j av a 2  s.  c o  m*/

int main(void){
    int count = MAX + 1;
    
    while (--count > 0) {
        printf("%d \n", count - 1);
    }
    
    return 0;
}

Result


Related Tutorials