#include <stdio.h>
main()
{
int a,b,c;
printf("write two numbers");
scanf("%d%d", &a,&b);
c=a+b;
printf("the sum of two numbers is%d",&c);
}
这是我使用的代码。 我正在使用代码块进行编译。
最佳答案
使用printf()
时,您打印的是位置而不是c
变量的值。删除&
即可获取c
的实际值。
printf("the sum of two numbers is%d",c)
关于c - 我的 C 程序给出了相同的计算结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50716241/