Unknown Unknown Author
Title: C++ Programming How to find a Sum using an Array
Author: Unknown
Rating 5 of 5 Des:
C++ Programming How to find a Sum using an Array This Program will show you how to find a sum of Different Numbers using Arrays in C++ Langu...

C++ Programming How to find a Sum using an Array

This Program will show you how to find a sum of Different Numbers using Arrays in C++ Language


Program # 4 : Find the Sum using an Array 


#include <iostream>

using namespace std;

int main()
{
    int avg[] = {6,14,100,40,40};
     int sum = 0;
    for(int x=0; x<5; x++){
        sum += avg[x];
        cout << sum << endl;
    }


}

Note : you can use any Numbers to find their Sun.

Output of the Program : 


Advertisement

Post a Comment

Please Don't Spam You are allowed to comment your website link

 
Top