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
write a progrmm in c language take user interface generate table using for loop?
How does normalization of huge pointer works?
What is the function of this pointer?
Explain what does the format %10.2 mean when included in a printf statement?
Is return a keyword in c?
Which control loop is recommended if you have to execute set of statements for fixed number of times?
What does it mean when a pointer is used in an if statement?
What is wrong with this declaration?
What is main return c?
Write a program of advanced Fibonacci series.
A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor
ATM machine and railway reservation class/object diagram
Explain how can I manipulate strings of multibyte characters?
A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM
What is the difference between far and near ?