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
When is a void pointer used?
What are the disadvantages of a shell structure?
how many errors in c explain deply
What is main () in c language?
Why c is procedure oriented?
Does c have class?
int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer
Explain Basic concepts of C language?
What is the difference between procedural and functional programming?
Why are algorithms important in c program?
Linked list is a Linear or non linear explain if linear how it working as a non linear data structures
Explain what is wrong with this program statement?
What is union in c?
any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above
How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?