Advertisement

FOR LOOP

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int a,b,c;
printf("ENTER NUMBER WHICH YOU WANT TO VIEW A TABLE\n\n");
scanf("%d" ,&a);
for(b=1;b<=10;b++)
//b is locate range in or looping 10 is looping time
{
c=a*b;
printf("%d\t*\t%d\t=\t%d\n" ,a,b,c);
}
getch();
}
// output
//6 * 1 = 6

Post a Comment

0 Comments