Wednesday, May 1, 2013

C program to print 1 to 100 using while-loop

//printing 1-100 using while-loop
#include<stdio.h>
//main function
void main(){
    //initializing integer i
    int i=1;
    //while-loop to display till 100
    while(i<=100){
        printf("%d,",i);
        i++;
    }
}

No comments:

Post a Comment