write a program to find the sum of the array elements in c
language?
Answer Posted / bishmeet singh
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],i,n,sum=0;
printf("enter the no. of elements");
back:
scanf("%d",&n);
if(n<10)
{
printf("elements sholud be less than 10\n enter again");
goto back;
}
printf("Enter %d elements",n);
for(i=0;i<n;i++)
{
scanf("%d",a[i]);
sum=sum+a[i];
}
printf("sum of your entered elements is %d",sum);
getch();
}
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
What functions are used in dynamic memory allocation in c?
Hello. How to write a C program to check and display president party like if i type in the console "biden" and hit enter the output shoud be : "biden is democrat" and if i type "trump" and hit enter the output shoud be: "trump is republican"
What are the string functions? List some string functions available in c.
how to introdu5ce my self in serco
What standard functions are available to manipulate strings?
Explain indirection?
How to establish connection with oracle database software from c language?
What is page thrashing?
the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above
Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above
Is void a keyword in c?
What does 3 mean in texting?
What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?
please give me some tips for the placement in the TCS.
What are the 4 types of unions?