xxxxxxxxxx
//algorithm: n=1 while(n<=5) {printf("\n %d",n); n++;}
#include<stdio.h>
main()
{
int n;
printf("While loop example: Incrementation 1-5");
n=1;
while(n<=5)
{
printf("\n%d",n);
n++;
}
}
xxxxxxxxxx
//algorithm: n=1 while(n<=5) {printf("\n %d",n); n++;}
#include<stdio.h>
main()
{
int n;
printf("Do-While loop example: Incrementation 1 to 5\n\n");
n=1;
do
{
printf("%d,",n);
n++;
}
while(n<=4);
printf("%d",n);
}