write a program to find the sum of the array elements in c
language?

Answer Posted / raushan kumar

# include <stdio.h>
# include <conio.h>
void main()
{
int arr[value],sum=0;
int i;
clrscr();
printf("Enter data in array");
/*store data in array*/
for(i=1;i<value;i++)
{
scanf("%d",&arr[i]);
}
/*Print data in array*/
for(j=1;j<value;j++)
{
printf("%d",arr[i]);
sum=sum+arr[i];
}
/*Sum of array element*/
printf("\nArray Element Sum=%d",sum);
getch();
}

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of typedef in c?

587


Why doesnt this code work?

618


What is your stream meaning?

605


Who developed c language and when?

586


What is volatile c?

525






Explain main function in c?

626


What is difference between far and near pointers?

612


What is the use of pragma in embedded c?

592


to find the closest pair

1823


Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.

3124


What are the Advantages of using macro

688


In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?

770


What is the difference between pure virtual function and virtual function?

652


any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above

659


What is the scope of an external variable in c?

569