write a program to find the sum of the array elements in c
language?
Answer Posted / mohd hayyan
#include<stdio.h>
#include<conio.h>
void main()
{
int a[i],i,sum=0;
clrscr();
printf("enter the array");
for(i=0;i<3;i++)
scanf("%d",&a[i]);
for(i=0;i<3;i++)
{
sum=sum+a[i];
}
for(i=0;i<3;i++)
{
printf("a[%d]=%d",i,a[i]);
}
printf("%d",sum);
getch();
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are valid signatures for the Main function?
What does s c mean in text?
I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.
What is ## preprocessor operator in c?
How many bytes is a struct in c?
With the help of using classes, write a program to add two numbers.
What is a stream in c programming?
Explain the use of #pragma exit?
Why does everyone say not to use gets?
What does the function toupper() do?
Explain what’s a signal? Explain what do I use signals for?
What is array of pointers to string?
What are terms in math?
What is difference between main and void main?
Are negative numbers true in c?