#include <stdio.h>
#include<conio.h>
int main()
{
int n, sum = 0, i, val;
clrscr();
printf("Enter the number of integers\n");
scanf("%d", &n);
printf("Enter %d numbers \n",n);
for (i = 1; i <= n; i++)
{
scanf("%d", &val);
sum = sum + val;
}
printf("Addition of %d numbers is = %d\n",n,sum);
getch();
return 0;
}
C program to add n numbers
#include<conio.h>
int main()
{
int n, sum = 0, i, val;
clrscr();
printf("Enter the number of integers\n");
scanf("%d", &n);
printf("Enter %d numbers \n",n);
for (i = 1; i <= n; i++)
{
scanf("%d", &val);
sum = sum + val;
}
printf("Addition of %d numbers is = %d\n",n,sum);
getch();
return 0;
}