write a program to find the sum of the array elements in c
language?
Answer Posted / anuja kulkarni
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5];
int 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);
} // end of main()
| Is This Answer Correct ? | 295 Yes | 71 No |
Post New Answer View All Answers
How do you define a function?
What are the features of c languages?
What is masking?
What are external variables in c?
Explain the use of function toupper() with and example code?
Write a program to show the change in position of a cursor using c
Are local variables initialized to zero by default in c?
When should the register modifier be used? Does it really help?
Why is sizeof () an operator and not a function?
program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)
write a program in c language to print your bio-data on the screen by using functions.
What is pass by value in c?
What functions are used in dynamic memory allocation in c?
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.
Why clrscr is used after variable declaration?