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
What is the difference between char array and char pointer?
What are loops c?
What is hashing in c language?
How can you find the exact size of a data type in c?
What is d scanf?
What is a constant and types of constants in c?
what are non standard function in c
Can a file other than a .h file be included with #include?
What does c mean in basketball?
What happens if a header file is included twice?
If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.
code for replace tabs with equivalent number of blanks
What is difference between static and global variable in c?
How to find a missed value, if you want to store 100 values in a 99 sized array?
What is typeof in c?