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
Why is a semicolon (;) put at the end of every program statement?
What are the types of data types and explain?
Why is main function so important?
explain how do you use macro?
a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler
What does *p++ do?
How important is structure in life?
How can I implement sets or arrays of bits?
What do the functions atoi(), itoa() and gcvt() do?
What is the use of the function in c?
What are the types of data files?
Write a program to print “hello world” without using semicolon?
What is a program flowchart and how does it help in writing a program?
What is a method in c?
what is the difference between class and unio?