For example:
#include
Void main ()
{
Int a, b, d;
While (a % 2!=0)
{
B=a/2;
D=a % 2;
A=b;
}
Printf (" % d ", d);
}
Where the program is wrong, on this foundation how to change, thank you
CodePudding user response:
This sentence while (a % 2!=0) obviously wrongWhen a==2?
Directly to the while (a!=0)
CodePudding user response:
This should not be on int, but should be aimed at unsigned, at least into unsigned calculation,