------------
do...while
------------
#include<stdio.h>
using namespace std;
main()
{
int a;
do
{
printf("Enter a:\n");
scanf("%d",&a);
}
while(a!=2);
}
----------
for loop
----------
#include<stdio.h>
using namespace std;
main()
{
for(int a=1;a<=5;a++)
{
printf("\t \n%d\t\t",a*5);
}
}
No comments:
Post a Comment