C Program to add elements of an array

By | 2017-09-14T13:11:30+00:00 September 14th, 2017|c-program|0 Comments

How to add elements in an array using C Program.

Add elements of an Array :

int main(void)
    int arr[10],i,total=0;
    for(i=0; i<10; i++)
        printf("Enter value for arr[%d] : ",i);
    printf("Total : %d\n",total);
    return 0;

[box type=”success” align=”alignleft” class=”” width=”100%”]

Enter value for arr[0] : 10
Enter value for arr[1] : 20
Enter value for arr[2] : 30
Enter value for arr[3] : 40
Enter value for arr[4] : 50
Enter value for arr[5] : 60
Enter value for arr[6] : 70
Enter value for arr[7] : 80
Enter value for arr[8] : 90
Enter value for arr[9] : 100
Total : 550


Happy Learning 🙂

About the Author:

Hi Folks, you have reach this so far, that shows you like what you are learning. Then why don't you support us to improve for bettor tutorials by leaving your valuable comments and why not you keep in touch with us for latest updates on your favorite blog @ facebook , twitter , Or Google+ ,

Leave A Comment