Nested string using for statement to print 1-5 multiplication table.
#include<stdio.h>
int main()
{
int i=1;
int j=1;
for (i=1; i<=5; i++)
{
for(j=1; j<=12; j++)
{
printf("%d * %d =%d \n", i,j, i*j);
}
printf("\n");
}
return(0);
}
Code that prins 1-5 mulplication table
#include<stdio.h>
int main()
{
int i=1;
while(i<=5)
{
int j=1;
while(j<=12)
{
printf("%d * %d =%d \n", i,j, i*j);
j++;
}
i++;
printf("\n");
}
return(0);
}