write a program to find the sum of the array elements in c
language?
Answer Posted / aisha
#include<Stdio.h>
void main()
{
int sum=0,a[10],i,n;
printf("enter value of n");
scanf("%d",&n);
printf("enter array elements");
for(i=o;i<=n;;i++)
scanf("%d",&a[i]);
for(i=0;i<=n;i++)
{
sum= sum+a[i];
}
printf("sum of all array elements = %d",sum);
}
Is This Answer Correct ? | 11 Yes | 5 No |
Post New Answer View All Answers
Explain how can a program be made to print the line number where an error occurs?
Write a code to generate a series where the next element is the sum of last k terms.
How can I sort more data than will fit in memory?
"C" language developed by "Dennis Ritchie" at AT & T. his remarks are a) too general, too abstract b) could deal with only specific problems c) lost generality of BCPL and B restored d) no remarks
What is calloc()?
i want to know the procedure of qualcomm for getting a job through offcampus
Why do we use header files in c?
what is a function method?give example?
Describe explain how arrays can be passed to a user defined function
What are the different types of errors?
In which layer of the network datastructure format change is done
1) write a program to generate 1st n fibonacci prime numbers using Nested if 2) write a program to generate twin prime numbers from m to n using nested if 3) write a program to check whether a given integer is a strong number or not using nested if 4) Write a program to generate prime factors of a given integer using nested if 5)write a program to generate prime numbers from m to n using nested if 6)write a program to generate perfect numbers from m to n using nested if 7)write a program to generate the pallindromes from m to n using neste if 8)write a program to generate armstrong numbers from m to n using nested if 9)write a program to generate strong numbers from m to n using nested if
Is c# a good language?
What is an array? What the different types of arrays in c?
What is graph in c?