Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <conio.h>
- int main()
- {
- int n, sum = 0, c, value;
- system ("cls");
- printf("Enter the number of integers you want to add\n");
- scanf("%d", &n);
- printf("Enter %d integers\n",n);
- for (c = 1; c <= n; c++)
- {
- scanf("%d",&value);
- sum = sum + value;
- }
- printf("Sum of entered integers = %d\n",sum);
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment