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

Answer Posted / lalit suthar, nilod

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

#include<stdio.h>
#include<conio.h>

void main()
{
int a[5],i,sum=0;

clrscr();

printf("Enter the array elements\n");

for (i=0; i<5; i++)

scanf("%d",&a[i]);

// sum of array elements

for (i=0; i<5; i++)
{
sum=sum+a[i];
}

printf("Sum of array elements===%d",sum);

getch();
}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how can a program be made to print the name of a source file where an error occurs?

693


How are portions of a program disabled in demo versions?

757


What are the types of operators in c?

616


What does s c mean on snapchat?

590


Describe static function with its usage?

616






How is a null pointer different from a dangling pointer?

562


write a c program to print the next of a particular no without using the arithmetic operator or looping statements?

3192


Stimulate calculator using Switch-case-default statement for two numbers

2453


What is data type long in c?

627


Write a program for finding factorial of a number.

637


hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel

1416


What is a lookup table in c?

630


Explain high-order bytes.

678


Write a simple code fragment that will check if a number is positive or negative.

713


What are categories used for in c?

574