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