1
#include <stdio.h>
int main() {
int i = -1;
int sum = 1000;
printf("\nThe value of sum to start is: %d", sum);
while (i <= 0) {
i = i - 1;
sum = sum + 1; }
if (sum == 0)
printf("\nSum is zero");
if (sum < 0)
printf("\nSum is less than zero");
if (sum > 0)
printf("\nSum is greater than zero");
printf("\n");
}
任何人都可以解釋爲什麼sum的結果會小於0嗎? 以及while循環將如何結束?二進制補碼算術
謝謝。它現在是有道理的。 –