Computer Science, asked by naman6418, 1 year ago

wap to find out average of element of array in c++

Answers

Answered by parzival9083
1

here is the program

#include <iostream>

using namespace std;

int main()

{

int a, b ,c,sum;

float average;

cin>>a>>b>>c;

sum = a+b+c;

cout<<"The sum of 3 numbers is:"<<sum<<endl;

average =sum/3;

cout<<"The average of 3 numbers is:"<<average<<endl;

return 0;

}

HOPE IT HELPS YOU

Similar questions