/*
Name: WAP to add n numbers
Author: Parveen Malik
Date: 23/09/11 10:43
*/
#include <stdio.h>
#include <conio.h>
int main()
{
int n,sum=0;
int count,var;
printf("Enter the number of integers you want to add : ");
scanf("%d",&n);
printf("Enter %d numbers \n",n);
for(count=1;count<=n;count++)
{
scanf("%d",&var);
sum=sum+var;
}
printf("Sum of entered numbers = %d \n",sum);
getch();
return 0;
}
OUTPUT :
0 comments:
Post a Comment