Computer Science, asked by venkybijjam2003, 1 day ago

write the c programe to find the sum of array elements​

Answers

Answered by aman01022007kumar
0

Explanation:

lements Using Standard Method

C

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

#include <stdio.h>

#include <conio.h>

 

int main()

{

    int a[1000],i,n,sum=0;

  

    printf("Enter size of the array : ");

    scanf("%d",&n);

    printf("Enter elements in array : ");

    for(i=0; i<n; i++)

    {

        scanf("%d",&a[i]);

    }

    

    for(i=0; i<n; i++)

    {

        

        sum+=a[i];

    }

     printf("sum of array is : %d",sum);

 

    return 0;

}

Similar questions