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 does void main () mean?
an expression contains relational operators, assignment operators, and arithmatic operstors. In the absence of parentheses, they will be evaluated in which of the following order a) assignment, relational, arithematic b) arithematic, relational, assignment c) relational, arithematic, assignment d) assignment, arithematic, relational
What is void c?
What are the 4 types of unions?
What does stand for?
What is ambagious result in C? explain with an example.
Explain what is the difference between the expression '++a' and 'a++'?
What is the easiest sorting method to use?
What is a macro, and explain how do you use it?
Explain how can I read and write comma-delimited text?
Explain what is a program flowchart and explain how does it help in writing a program?
What do you understand by normalization of pointers?
What is the benefit of using an enum rather than a #define constant?
How can you convert integers to binary or hexadecimal?
Write a program to print numbers from 1 to 100 without using loop in c?