#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],i,n,sum=0;
clrscr();
printf("How many you want to insert ?\n");
scanf("%d",&n);
printf("Enter the numbers::\n");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
sum=sum+a[i];
}
printf("The Sum is=%d",sum);
getch();
}
#include<conio.h>
void main()
{
int a[10],i,n,sum=0;
clrscr();
printf("How many you want to insert ?\n");
scanf("%d",&n);
printf("Enter the numbers::\n");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
sum=sum+a[i];
}
printf("The Sum is=%d",sum);
getch();
}
No comments:
Post a Comment