write a program to find the sum of the array elements in c
language?

Answer Posted / vaibhav

#include<stdio.h>
#include<conio.h>
void main()
{
int n[5],sum=0,i=0;
clrscr();
for(i=0;i<4;i++)
{
scanf("%d",&n[i]);
}

for(i=0;i<4;i++)
{
sum=sum+n[i];
}
printf("sum are%d",sum);
getch();
}

Is This Answer Correct ?    72 Yes 41 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what are linked list?

613


How can I open files mentioned on the command line, and parse option flags?

583


What is a ternary operator in c?

646


find out largest elemant of diagonalmatrix

1640


Difference between Shallow copy and Deep copy?

1562






i got 75% in all semester am i eligible for your company

1728


Is there a way to jump out of a function or functions?

627


What are the standard predefined macros?

627


How can I handle floating-point exceptions gracefully?

622


What is the difference between functions abs() and fabs()?

641


how could explain about job profile

1446


Explain why c is faster than c++?

564


What is an lvalue?

627


if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting.

4485


What is the difference between memcpy and memmove?

593