/*-------------------------------------------------------------------*/ /* sumflat.c */ /*-------------------------------------------------------------------*/ #include static int i; static int iFirst; static int iSecond; static int iSum = 0; int main(int argc, char *argv[]) /* Read two integers from stdin, and write to stdout the sum of all integers between the two. */ { printf("Enter an integer: "); scanf("%d", &iFirst); printf("Enter another integer that is greater than the first: "); scanf("%d", &iSecond); i = iFirst; loop1: if (i > iSecond) goto loopend1; iSum += i; ++i; goto loop1; loopend1: printf("The sum of all integers between the two is %d.\n", iSum); return 0; }