#include #include #include using namespace std; //myArrayVector1.cpp int deviation( int ); static int total1, total2; int mean ; int main() { int n1[10] = { 69 ,60,63,61,65,64,71,70,68,64 }; cout<<"\n Arrays Length : " < Vint1( n1, n1+10 ); // copy of n1 vector::iterator it; // iteration cout <<"\n ------Using vector :------\n "; for(it= Vint1.begin(); it !=Vint1.end(); it++) { cout <<" "<< *it; total1 = total1 + *it; } mean = total1/10; cout <<"\n \t total1 " << total1 << "\n \t avg "<< mean; cout <<"\n ------Using Array :------\n "; for(int i=0; i <10; i++) { total2 = total2 + n1[i]; cout<<" " << n1[i]; } mean = total2/10; cout <<"\n total2 " << total2 << " avg "<< mean; // cout<<"\n using array deviation \n"; for(int i=0; i <10; i++) { cout<<" " << deviation(n1[i]); } return 0; } int deviation( int value ) { return (mean -value); }