fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int num, sum = 0;
  5. int i = 1;
  6.  
  7. while (i <= 5) {
  8. printf("Enter an integer #%d: ", i);
  9. scanf("%d", &num);
  10. sum += num;
  11. i++;
  12. }
  13.  
  14. printf("The summation is %d.\n", sum);
  15. return 0;
  16. }
Success #stdin #stdout 0s 5276KB
stdin
Standard input is empty
stdout
Enter an integer #1: Enter an integer #2: Enter an integer #3: Enter an integer #4: Enter an integer #5: The summation is 27015.