write a program to find the sum of the array elements in c
language?
Answer Posted / rajkumar
//c program of sum array element
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n,sum=0,n,a[100];
clrscr();
printf("How many number are you entering(less than 100) ?");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d",&a[i]);
}
//sum of array element
for(i=1;i<=n;i++)
{
sum=sum+a[i];
}
printf("Sum of your entered number is=%d",sum);
getch();
}//End of main
Is This Answer Correct ? | 24 Yes | 9 No |
Post New Answer View All Answers
What is #error and use of it?
What is use of integral promotions in c?
What is c system32 taskhostw exe?
A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM
code for quick sort?
typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?
what is reason of your company position's in india no. 1.
Why does notstrcat(string, "!");Work?
Write a simple code fragment that will check if a number is positive or negative.
What is function pointer c?
Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon
What do you mean by c?
can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......
What is the correct declaration of main?
Is main is a keyword in c?