So, this will be my first time asking for help with something on this site.
Currently, I am learning c, and I have progressed up to the nested loops.
I think you guys will understand my problem if I present the program, and explain what I want to do.
#include <stdio.h>
void main()
{
int i, n1, n2;
printf("Enter the value of n1 and n2:");
scanf("%d%d",&n1,&n2);
while(n1<=n2)
{
i=1;
while(i<=10)
{
printf("%2d*%2d=%2d\n",n1,i,i*n1);
i++;
}
n1++;
}
}
Currently, the program above gives the output like this:
If I entered the values like five and seven:
5*1=5
5*2=10
It would go up to 50.
Same thing for the six and seven.
But I want the output in this manner:
Once more, I enter the values five and seven:
Then I want the output in this way:
5*1=5
6*1=6
7*1=7
Until the table of all three number is over. (reaching the 50, 60, and 70.) So how can I accomplish this?