Question: The following function has a bug and doesn't work as expected. What is the issue with this function and how will you fix it?

  
The following function has a bug and doesn't work as expected. What 

The following function has a bug and doesn't work as expected. What is the issue with this function and how will you fix it? //lfx is greater than y, this function should return 1. //Else, this function returns 0. intis greater(unsignedintx.unsignedinty) { if(x-y>0) return 1; else return 0; }

Step by Step Solution

3.36 Rating (146 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!