write a program to find the sum of the array elements in c
language?
Answer Posted / heemashree
#include "stdio.h"
#include "conio.h"
#include "stdafx.h"
void main()
{
int a[10];
int i,sum=0,n;
printf("enter number of elements");
scanf("%d",&n);
printf("Enter the array elements\n");
for (i=0; i<n; i++)
scanf("%d",&a[i]);
// sum of array elements
for (i=0; i<n; i++)
{
sum=sum+a[i];
}
printf("Sum of array elements===%d",sum);
}
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
how we can make 3d venturing graphics on outer interface
What does %p mean c?
How many identifiers are there in c?
What is clrscr in c?
How can a program be made to print the name of a source file where an error occurs?
provide an example of the Group by clause, when would you use this clause
What is include directive in c?
how to capitalise first letter of each word in a given string?
what is the diffrenet bettwen HTTP and internet protocol
What is indirection?
What is operator precedence?
can anyone suggest some site name..where i can get some good data structure puzzles???
Write a program with dynamically allocation of variable.
What does the error message "DGROUP exceeds 64K" mean?
What is the difference between printf and scanf )?