#include<stdio.h>
#include<conio.h>
main()
{
int n, sum = 0, c, var;
printf("Enter the number of integers you want to add\n");
scanf("%d",&n);
printf("Enter %d numbers\n",n);
for ( c = 1 ; c <= n ; c++ )
{
scanf("%d",&var);
sum = sum + var;
}
printf("Sum of entered numbers = %d\n",sum);
getch();
return 0;
}
0 Comments