#include "stdafx.h" #include <iostream> using namespace std; void f(int&, int); int main() { int N, s; cout << "how many? "; cin >> N; f(N, s); cout << "The result = " << (double) s / N << endl; return 0; } void f(int &n, int s) { int m; cout << "enter " << n << " integers:- " << endl; for (; n > 0; n--) { cin >> m; s = s + m; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)