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
How to write a code for implementing my own printf() and
scanf().... Please hep me in this... I need a guidance...
Can you give an coding for c... Please also explain about
the header files used other than #include
What is an expression?
What are nested functions in c?
all c language question
How are structure passing and returning implemented?
Why array is used in c?
‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.
What does #pragma once mean?
What is adt in c programming?
Tell me what is null pointer in c?
Are the variables argc and argv are local to main?
which of the following shows the correct hierarchy of arithmetic operations in C a) (), **, * or/,+ or - b) (),**,*,/,+,- c) (),**,/,*,+,- d) (),/ or *,- or +
What is an endless loop?
Explain the red-black trees?
Is a pointer a kind of array?