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


Please Help Members By Posting Answers For Below Questions

What is #error and use of it?

681


What is use of integral promotions in c?

664


What is c system32 taskhostw exe?

585


A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM

1699


code for quick sort?

1622






typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?

1068


what is reason of your company position's in india no. 1.

1774


Why does notstrcat(string, "!");Work?

641


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

708


What is function pointer c?

586


Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon

5462


What do you mean by c?

587


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......

1409


What is the correct declaration of main?

676


Is main is a keyword in c?

606