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
What is the use of typedef in c?
Why doesnt this code work?
What is your stream meaning?
Who developed c language and when?
What is volatile c?
Explain main function in c?
What is difference between far and near pointers?
What is the use of pragma in embedded c?
to find the closest pair
Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.
What are the Advantages of using macro
In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?
What is the difference between pure virtual function and virtual function?
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
What is the scope of an external variable in c?