c++输出九九乘法表
时间: 2024-06-04 16:01:37 浏览: 111
输出九九乘法表
Sure! Here is the code to generate the multiplication table:
```c
#include <stdio.h>
int main() {
int i, j;
for(i = 1; i <= 9; i++) {
for(j = 1; j <= i; j++) {
printf("%d * %d = %d\t", j, i, i * j);
}
printf("\n");
}
return 0;
}
```
This code uses nested loops to iterate through the numbers from 1 to 9 and prints out the multiplication table. Each line represents a row, and each entry within a row represents the multiplication of the corresponding row and column numbers.
阅读全文