Advertisement
saira12tabassum19

Untitled

Jul 1st, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int n, sum = 0, c, value;
  6.  
  7. printf("How many numbers you want to add?\n");
  8. scanf("%d", &n);
  9.  
  10. printf("Enter %d integers\n", n);
  11.  
  12. for (c = 1; c <= n; c++)
  13. {
  14. scanf("%d", &value);
  15. sum = sum + value;
  16. }
  17.  
  18. printf("Sum of the integers = %d\n", sum);
  19.  
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement