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
Explain how can a program be made to print the name of a source file where an error occurs?
How are portions of a program disabled in demo versions?
What are the types of operators in c?
What does s c mean on snapchat?
Describe static function with its usage?
How is a null pointer different from a dangling pointer?
write a c program to print the next of a particular no without using the arithmetic operator or looping statements?
Stimulate calculator using Switch-case-default statement for two numbers
What is data type long in c?
Write a program for finding factorial of a number.
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
What is a lookup table in c?
Explain high-order bytes.
Write a simple code fragment that will check if a number is positive or negative.
What are categories used for in c?