write a 'c' program to sum the number of integer values
Answer Posted / neha shree
void main()
{
int a,n,i,sum=0;
printf("enter n value");
scanf("%d",&n);
printf("\n Enter the numbers");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
sum+=a[i];
printf("\nSum of the given numbers is %d",sum);
}
| Is This Answer Correct ? | 9 Yes | 12 No |
Post New Answer View All Answers
What are header files in c programming?
Write a program to check palindrome number in c programming?
Is flag a keyword in c?
What do the functions atoi(), itoa() and gcvt() do?
What is size of union in c?
Between macros and functions,which is better to use and why?
What is the purpose of & in scanf?
State the difference between x3 and x[3].
In a switch statement, what will happen if a break statement is omitted?
Which node is more powerful and can handle local information processing or graphics processing?
What is meant by keywords in c?
What is volatile variable how do you declare it?
Explain what are multibyte characters?
How can a process change an environment variable in its caller?
Compare interpreters and compilers.