编写如下:
#include
int main()
{int i,j;for(i=1;i<=9;i++)
{for(j=1;j<=i;j++)
{printf("%d*%d=%d ",i,j,i*j);}
printf("\n");}return 0;}
运行结果
扩展资料:
其余方法如下:
乘法口诀参考答案
main()
{ int a=1,b=1;
clrscr();
do
{ do{ printf(" %d*%d=\%d\t",b,a,a*b);
b++;} while (b<=a);
printf("\n");
a++;
b=1;} while (a<10);}
乘法口诀参考答案
main()
{ int a=1,b=1;clrscr();
while (a<10)
{ while (b<=a)
{ printf(" %d*%d=%d\t",b,a,a*b);
b++}
printf("\n");
a++;b=1;}}
乘法口诀
main()
{ int a=1,b=1;
clrscr();
loop: printf(" %d*%d=%d\t",b,a,a*b);
if(a==b)
{ printf("\n");
a++;
b=1;
if(a>9) goto end;}
else b++;
goto loop;
end:;}