C语言输出小九九乘法表

时间:2022-06-21 09:01:13
#include <math.h>
#include <stdio.h>
int main()
{
    int i,j,c;
    i=1;
    j=1;
    c=1;
    for(i=1;i<=9;i++)
        {
            for(j=1;j<=9;j++)
                {
                    if(i>=j)
                        {
                            c=i*j;
                            printf("%d*%d=%d ",i,j,c);
                        }
                    else
                        {
                            printf("\n");
                            break;
                        }
                }
        }
    getchar();
}