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
1
Expert's answer
2014-10-17T15:02:07-0400
it must be:

if(stud.getEdad()&gt; stud[j].getEdad())
{
tempura=stud.getEdad();
stud.getEdad(stud[j].getEdad());
stud[j].getEdad(tempura);
}
[i]
[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 the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS