我是 C 编程的新手,我遇到了一个简单的问题。这是以下代码...
#include <stdio.h>
/* Write a C Program that accepts two integers from the
user and calculate the sum of the two intergers. Go to the editor!
*/
int main()
{
int firstInteger, secondInteger;
int sum;
printf("Input two Integers: \n");
scanf("%d%d", &firstInteger, &secondInteger);
sum = firstInteger + secondInteger;
printf("%d", sum);
return 0;
}
在 GCC 编译器上运行我的代码后,我没有得到我期望的结果!
C:\XXXX\XXXX\XXXX\XXXX\XXXX>gcc 2sumOfTwoIntegers.c
C:\XXXX\XXXX\XXXX\XXXX\XXXX>a
Input two Integers:
25, 38
25
为什么我没有得到我输入的整数的总和?