aboutsummaryrefslogtreecommitdiff
path: root/challenge-122/karishma/cpp/ch1.cpp
blob: 821e88134df30102fdf6a660a8b55d726c9ec157 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <iostream>
using namespace std;

int main() {
    int n=5;
    int ptr[]={10,20,30,40,50};
    int sum = 0;
    for (int j = 1; j <= n; j++) {
        sum += ptr[j-1];
        int k= sum/j; 
        cout<<k;
        cout<<endl;
    }
    cout<<endl;
    
    return 0;
}