In the third output it should be “N is divisible by only A” but it is showing “N is divisible by A and B”
Yeah, so you have done something wrong in your code. Try to debug it.