Nested for loop
Ex;
for(i=0;i<10;i++)
{
for(j=0;j<10;j++)
{
//Code...
}
}
//write a program to print multiplication table 10X10
#include<conio.h>
#include<stdio.h>
void main()
{
int i,j,n;
clrscr();
printf("\n 10 X 10 Multiplication Table \n");
for(i=1;i<=10;i++)
{
for(j=1;j<=10;j++)
{
printf("%d X %d = %d",j,i,(j*i));
}
printf("\n");
}
getch();
}
O/P:
Check yourself.......
Ex;
for(i=0;i<10;i++)
{
for(j=0;j<10;j++)
{
//Code...
}
}
//write a program to print multiplication table 10X10
#include<conio.h>
#include<stdio.h>
void main()
{
int i,j,n;
clrscr();
printf("\n 10 X 10 Multiplication Table \n");
for(i=1;i<=10;i++)
{
for(j=1;j<=10;j++)
{
printf("%d X %d = %d",j,i,(j*i));
}
printf("\n");
}
getch();
}
O/P:
Check yourself.......
No comments:
Post a Comment