while (test condition)
{
body of the loop
}
# include < stdio.h > //include the stdio.h file
void main() // Start of your program
{
int n, i=0; //Declare and initialize the variables
printf(“Enter the upper limit number”); //Message to the user
scanf(“%d”, &n); //read and store the number
while(I < = n) // While statement with condition
{ // Body of the loop
printf(“\t%d”,I); // print the value of i
I++;// increment I to the next natural number.
}
}