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
Explain why C language is procedural?
What are the c keywords?
What are unions in c?
write a program to concatenation the string using switch case?
What is null pointer constant?
Difference between Function to pointer and pointer to function
What is an operator?
What are the 5 types of inheritance in c ++?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
How can I do serial ("comm") port I/O?
Write a program to swap two numbers without using a temporary variable?
Explain how can I convert a string to a number?
Does sprintf put null character?
Write a simple code fragment that will check if a number is positive or negative.
differentiate built-in functions and user – defined functions.