a=8,b=9,用c语言输出8*8=64,8*9=72
时间: 2023-06-10 12:05:28 浏览: 105
请使用如下代码:
```
#include <stdio.h>
int main() {
int a = 8;
int b = 9;
int product1 = a * a;
int product2 = a * b;
printf("%d*%d=%d\n", a, a, product1);
printf("%d*%d=%d\n", a, b, product2);
return 0;
}
```
输出结果为:
```
8*8=64
8*9=72
```
相关问题
a=1.b=2输出最大值的C语言程序
#include <stdio.h>
int main() {
int a = 1;
int b = 2;
if (a > b) {
printf("最大值是: %d\n", a);
} else {
printf("最大值是: %d\n", b);
}
return 0;
}
// 输出:最大值是:2
c语言输出c=a+b
你好,以下是C语言输出c=a+b的代码示例:
```c
#include <stdio.h>
int main() {
int a = 10, b = 20, c;
c = a + b;
printf("c = %d\n", c);
return 0;
}
```
在这个例子中,我们定义了三个变量a、b和c,分别表示加法运算的两个操作数和运算结果。然后我们使用a和b的和来计算c的值,最后使用printf函数输出c的值。
相关推荐
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)