+ 5

why this code show errors

please tell me how to fix this error https://code.sololearn.com/cfzDU00C380d/?ref=app

20th Jun 2018, 5:07 PM
Vishal Singh
Vishal Singh - avatar
5 Answers
+ 3
you redeclare the variables x y z in line 6 erase the codes on line 6,8 and 13 then in the main function write the code cout<<average(2,3,7); then your code will be fine here is the correct code https://code.sololearn.com/c32ZHTbZSWJ1/?ref=app
20th Jun 2018, 5:20 PM
estifanos
estifanos - avatar
+ 4
You alerdy declared x,y,z as parameter so you can't redeclare it inside the func also use: cout<<average(x,y,z); instead of int average(x,y,z);
21st Jun 2018, 5:53 AM
Shahil Ahmed
Shahil Ahmed - avatar
+ 2
Erase line number 6 .. There is a multiple declaration of x,y,z variables write. cout << average (2,3,7)
20th Jun 2018, 5:17 PM
Aveek Bhattacharyya
Aveek Bhattacharyya - avatar
+ 1
https://code.sololearn.com/cYeyDKtay1P2/?ref=app Made some edits here , its working now. outputs : the average is 3.
22nd Jun 2018, 7:05 AM
Kanishk Mewal
Kanishk Mewal - avatar
0
delete int x,y,z; and int before function avrage(2,3,7)
22nd Jun 2018, 4:48 PM
No Timr‎