Addition of Array elements

#include
#include
void main()
{
    int arr[100], i, no,sum=0;
    clrscr();
    printf("\nEnter the no. of elements: ");
    scanf("%d",&no);
    for(i=0;i

Output:

Enter the no. of elements: 5
Enter element 1 : 1
Enter element 2 : 2
Enter element 3 : 3
Enter element 4 : 4
Enter element 5 : 5
Sum of Array element: 15

You may also like...

5 Responses

  1. nice very good example its helpful for me

  2. laurencev says:

    Example needlessly abbreviates identifiers. Needlessly reduces readability.

Leave a Reply

Your email address will not be published. Required fields are marked *