Why my output is different?

I have written int rem = dividend % divisor outside while loop. Is anything wrong in it? If yes, then why?

Here is the code. Kindly check it.

@saijaltripathy_e79096f8f1ec20e3 since you haven’t used remainder variable anywhere in your code so you can use any value of remainder. The remainder variable here is futile.

Can you please elaborate it? I couldn’t understand.

@saijaltripathy_e79096f8f1ec20e3 you haven’t used remainder variable anywhere in the code.Yes you have declared it after declaring did you used it anywhere else?

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.

I am still not getting it. You are telling that I havent used remainder variable anywhere. But I have written it, int remainder = dividend % divisor. So I have used it.

please reply. My doubt is still not clear.