FIND THE ANSWERS

Write a program to sum integers entered interactively using while loop.in c?

Answer this question

  • Write a program to sum integers entered interactively using while loop.in c?


Answers

Answer #1 | 23/12 2013 00:52
I would just use Excel if I needed to sum some numbers.
Positive: 52 %
Answer #2 | 23/12 2013 01:30
Do you mean finding the sum each time a new integer is entered? If so, then try this: #include int main() { int num; long sum; while (scanf("%ld", &sum) == 1) { printf("%ldn", sum); while (scanf("%d", &num) == 1) { sum += num; printf("%ldn", sum); } } return(0); } Press ctrl + D (On Linux) or ctrl + Z (on Windoze) to reset the sum. Press it twice to close the program.
Positive: 46 %

Possible answer

Java Programming Tutorial ... You can check if a char c is a letter either using built-in ... Write a program called SumDigits to sum up the ...
Read more
Positive: 52 %
I need to write a program that ... The header holds all of the string stuff from C that's not as convenient. while ... Calculate Average and Grade.
Read more
Positive: 47 %
C Programming Tutorial. ... This means that once you write your C program, ... while (a < b); The for loop in C is simply a shorthand way of expressing a ...
Read more
Positive: 33 %
... Double Array Elements Methods. Write a method, ... Print an extra number before the loop. In ... Prompt for Array and Search Write a program using the ...
Read more
Positive: 10 %

Show more results