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[5],i,sum=0;
clrscr();
printf("enter the 5 elements to sum");
for(i=0;i<5;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<5;i++)
{
sum=sum+a[i];
}
printf("sum of the elements is %d",sum);
}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Do you know the purpose of 'register' keyword?

642


Why is c used in embedded systems?

614


What are the difference between a free-standing and a hosted environment?

745


write a c program to do the following: a) To find the area of a triangle. b) To convert the temperature from Fahrenheit to Celsius. c) To convert the time in hours : minutes : seconds to seconds.

1518


What are enums in c?

661






What is a program flowchart and explain how does it help in writing a program?

675


Which is better oop or procedural?

634


1) write a program to generate 1st n fibonacci prime numbers using Nested if 2) write a program to generate twin prime numbers from m to n using nested if 3) write a program to check whether a given integer is a strong number or not using nested if 4) Write a program to generate prime factors of a given integer using nested if 5)write a program to generate prime numbers from m to n using nested if 6)write a program to generate perfect numbers from m to n using nested if 7)write a program to generate the pallindromes from m to n using neste if 8)write a program to generate armstrong numbers from m to n using nested if 9)write a program to generate strong numbers from m to n using nested if

3982


Write a program to print factorial of given number using recursion?

603


How does sizeof know array size?

629


What are the string functions? List some string functions available in c.

605


what is recursion in C

616


in iso what are the common technological language?

1637


What is an expression?

657


Explain main function in c?

627