void main
int a[],n,i,sum=0;
printf("Enter n Value!");
scanf("%d", &n);
printf("\n Enter the number");
for(i=0;i<n;i++)
{
scanf("%d", &a[i]);
}
for(i=0;i<n;i++){
sum+=a[i];
printf("\n Sum of the five number is %d", sum);
}
I want to know that is it the right code or not?
If it's wrong so could any one give me the right one?
I'm looking forward to hearing from your answer.
This post has been edited by jenson200986: 04 January 2010 - 07:14 PM

New Topic/Question
Reply




MultiQuote









|