Playing with bits

I have absolutely no idea what is going wrong in this

Hello @Aug19LPPP0135,

Can you please share your code with me?

Steps:

  1. Open online Coding Blocks IDE: https://ide.codingblocks.com/
  2. Paste your code there.
  3. Save it there.
  4. Share the URL generated.

Hope, this would help.
Give a like, if you are satisfied.

Hello @Aug19LPPP0135,

Solution:

  1. Create a temporary variable (say temp) inside the outer while function.
  2. Assign it the value a.
  3. Pass it to the inner while function instead of passing a.

Reason:
After each iteration of outer while loop, the value of a becomes 1 as the inner while loop modifies its value.

Modification:
I have modified your code:

Hope, this would help.
Give a like, if you are satisfied.

1 Like