Code:
#include<stdio.h>
void main()
{int j,i,n,step,l,u,tab[10][10];
char ch;
do
{
printf("\nEnter Lower and Upper Limit ");
scanf("%d%d",&l,&u);
if(u-l!=10)
{ printf("\nSorry! print only 10 tables");
goto exit;
}
n=l;
for(i=0;i<10;i++)
{ step=1;
for(j=0;j<10;j++)
{
tab[j][i]=step*n;
step++;
}
n++;
if(n>u)
goto abc;
}
abc:
for(i=0;i<10;i++)
{
for(j=0;j<10;j++)
{ printf("%d\t",tab[i][j]);
}
printf("\n");
}
exit:
printf("\n\nPress y for next observation");
scanf("%s",&ch);
}while(ch=='y'||ch=='Y');
}
Output:
#include<stdio.h>
void main()
{int j,i,n,step,l,u,tab[10][10];
char ch;
do
{
printf("\nEnter Lower and Upper Limit ");
scanf("%d%d",&l,&u);
if(u-l!=10)
{ printf("\nSorry! print only 10 tables");
goto exit;
}
n=l;
for(i=0;i<10;i++)
{ step=1;
for(j=0;j<10;j++)
{
tab[j][i]=step*n;
step++;
}
n++;
if(n>u)
goto abc;
}
abc:
for(i=0;i<10;i++)
{
for(j=0;j<10;j++)
{ printf("%d\t",tab[i][j]);
}
printf("\n");
}
exit:
printf("\n\nPress y for next observation");
scanf("%s",&ch);
}while(ch=='y'||ch=='Y');
}
Output:
Enter Lower and Upper Limit
5
15
5 6 7 8 9 10 11 12 13 14
10 12 14 16 18 20 22 24 26 28
15 18 21 24 27 30 33 36 39 42
20 24 28 32 36 40 44 48 52 56
25 30 35 40 45 50 55 60 65 70
30 36 42 48 54 60 66 72 78 84
35 42 49 56 63 70 77 84 91 98
40 48 56 64 72 80 88 96 104 112
45 54 63 72 81 90 99 108 117 126
50 60 70 80 90 100 110 120 130 140
Press y for next observation
No comments:
Post a Comment