answersLogoWhite

0


Best Answer

main()
{
int n,a[i],s;
s=0;
printf("enter no of elements in array");
scanf("%d",&n);
printf("Enter elements in array");
for(i=;i{
scanf("%d",&a[i]);
s+=a[i];
}
printf("sum of elements=%d",s);
return;
}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

viod main()

{

int a,b,c;

float sum,avg;

a=10;

b=20;

c=30;

sum=a+b+c;

avg=sum/3;

print("\n Avg : "avg);

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a C programme to find out sum of the array elements?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you write a programme in c language using arrays to store a ten integer data and find the second smallest and second largest elements in the array?

void mail ( ); { int a, b c = a+b; printf ("%d",=c); }


How can you find the length of a single dimensional array in BlueJ?

array.length will return the number of elements in array.


What is the algorithm using c to delete duplicate elements from an array?

To detect the duplicate, you will have to write a nested loop that compares each element with all the previous elements.To actually delete the duplicate, once you find it, you have to move over all the elements after the duplicate. If the order of the elements doesn't matter, it is faster to just move the LAST array element, overwriting the duplicate element. Use a variable to keep track how many elements of the array are "usable". For example, if your array had 10 elements, and you delete 1, the array size will still be 10... but (after moving the elements over) only 9 of those elements have useful information.


How you can find out the number of elements and free elements in a pointer array?

You can find the number of elements and free elements in a pointer array by iterating through the array and counting the number of elements that are null versus the number that are non-null. Of course, this technique's success depends on proper initialization of each element, i.e. when first created or when deleted, it must be set to null.


What is the index number of the last element of an array with 9 elements?

(array.length - 1) will find the index of the last element in an array (or -1 if the array is empty).


Write a java programme to find minimum number in the given array?

public int min(int[] arr) { int min = Integer.MAX_VALUE; for(int e : arr) if(e<min) min=e; return min; }


How do you find missing numbers in a array with elements below its size?

Please rephrase your question. An array usually has a fixed size and I don't recall ever having to "go below its size". This implies that the missing elements are not within the range of the array.


How do you write c programme to find proper subset of a given string?

you can use strstr()


Write a c program to find the maximum value of 25 element in an array?

int findMax(int *array) { int max = array[0]; for(int i = 1; i < array.length(); i++) { if(array[i] > max) max = array[i] } return max; }


Is it true In a binary search if the search fails to find the item on the first attempt then there are 999 elements left to search in an array of 1000 elements?

False. In a binary search, if the search fails on the first trial of an array of 1000 elements, then there are only nine more elements left to search.


How do you write a program in C to find and display the sum of each row and column of a 2 dimensional array of type float?

array type


Write a c program to find the maximum of two numbers and print out with its position?

maxValue = function (array) {mxm = array[0];for (i=0; i<array.length; i++) {if (array[i]>mxm) {mxm = array[i];}}return mxm;}; i don't know