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

Integers: C supports these ... Print these patterns using nested loop (in a program called ... Write your program documentation while writing your ...
Read more
Positive: 52 %
INTRODUCTION TO FOR AND WHILE LOOPS IN ... Write a for loop to compute the sum of the squares of all integers from 2 ... learning how to write programs.
Read more
Positive: 47 %
average of numbers entered by ... to hold the sum of all the numbers the user entered. ... them right before using them, but this is a very simple program.
Read more
Positive: 33 %
Write a program which uses a while loop to sum the squares of integers ... Rewrite the calendar program from exercise 3 using ... or write the loop in ...
Read more
Positive: 10 %

Show more results