why my code isnt working . plz help, here is the link
Code not working
i tried sharing using coding block ide but there share option is not working .
Okay do it like this
Open ide.codingblocks.com
Paste your code there which you want me to debug
Then click file , here you will see a safe button
Press it. Wait for 2 seconds it will get save and after that it will generate a special url like ide.codingblocks.com/s/28xxxx share that url with me.
Still an issue , you can ask me that too
Perfect, now be patient I’ll debug it and let you know your mistake.
Your code is working fine, but doesn’t fill all prerequisites of the problem statement.
With input of this:
79
4
Eve 78
Bob 99
Suzy 86
Alice 86
Expected output was:
Bob 99
Alice 86
Suzy 86
Yours is giving this:
Bob 99
Suzy 86
Alice 86
Also I can see that you haven’t used in built sort function which was also a prerequisite.
Therefore your code works perfectly fine, but not giving desired output.
Take reference from this code
And apply it in your code
sir ik my code is running but its giving wrong ans for the given case. i have already sucessfully passed this problem using inbuilt sort . out of curiosity i was trying using bubble sort. i used same parameters but failed . just wanted to know why this is not giving correct ans. where have i gone wrong
the logic you have used with your comp1 and swap function isn’t working when salary of 2 employees are equal and we have to sort them on the basis of their name.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.