64 593
Assignments Done
99,2%
Successfully Done
In September 2018

Answer to Question #47951 in C++ for edzel

Question #47951
if (count > 0) {
for( i = 0; i <= MAX - 2; i++){
for( j = i + 1; j <= MAX - 1; j++){

if(stud[i].getEdad() > stud[j].getEdad()){
tempura=stud[i].getEdad();
stud[i].getEdad() = stud[j].getEdad();
stud[j].getEdad() = tempura;
}
}
}
cout <<"---------------------------------------\n";
} else {
cout <<"NONE\n";
}
What is wrong about this please help
the output for this is
0. 0
1.0
2.0
Expert's answer
it must be:
&nbsp;
if(stud.getEdad()&gt; stud[j].getEdad())
{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tempura=stud.getEdad();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stud.getEdad(stud[j].getEdad());
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stud[j].getEdad(tempura);
}
[i]&nbsp;
[i]Becauseyou cannot assign a value of function
Better if you send me all the code[i]

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions