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
Do you know the purpose of 'register' keyword?
Why is c used in embedded systems?
What are the difference between a free-standing and a hosted environment?
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.
What are enums in c?
What is a program flowchart and explain how does it help in writing a program?
Which is better oop or procedural?
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
Write a program to print factorial of given number using recursion?
How does sizeof know array size?
What are the string functions? List some string functions available in c.
what is recursion in C
in iso what are the common technological language?
What is an expression?
Explain main function in c?