0
what is the wrong here
#include <iostream> using namespace std; double avg(int m1, int m2, int m3) { double avg=0; avg=(m1+m2+m3)/3; return (avg); } int main() { int m1,m2,m3; cin>>m1>>m2>>m3; cout<<"the avardge = "<<avg((m1,m2,m3)/3); return 0; }
4 Respuestas
+ 3
1) Functions and variables names cannot be same.
2) When calling function, you only need to pass specified arguments.
In your cout statement, function call should be like avg(m1, m2, m3).
Change either function name or variable name in your own defined function.
+ 1
Nose carnal :v
+ 1
thank you alot
nAutAxH AhmAd
0
Jaciel Higuera
i do not understand what u have said