write a program to find the sum of the array elements in c
language?
Answer Posted / syed shoaib
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5];
int i,b=0;
printf("Enter the array elements\n");
for (i=0; i<5; i++)
scanf("%d",&a[i]);
for (i=0; i<5; i++)
{
b=b+a[i];
}
printf("Sum of array elements is %d",b);
}
| Is This Answer Correct ? | 19 Yes | 13 No |
Post New Answer View All Answers
What is c programing language?
Write a program that accept anumber in words
What does return 1 means in c?
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
Explain can static variables be declared in a header file?
What are the Advantages of using macro
What are structure members?
which is an algorithm for sorting in a growing Lexicographic order
Is c a great language, or what?
Can the size of an array be declared at runtime?
the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters
Is it possible to execute code even after the program exits the main() function?
What is const volatile variable in c?
What is ctrl c called?
What is meant by recursion?