History, asked by nischaltripathi3652, 10 months ago

The program must accept an interger N ad the input the program must print yes if it is a multiple of 6 and either 4or8 else the program must print no as the output

Answers

Answered by Anonymous
1

if (log n) / (log 3) is integral then n is a power of 3. Recursively divide by 3, check that the remainder is zero and re-apply to the quotient.

...

I might follow these steps:

I divide by 10^10 and get a quotient of 10000000 and a remainder of 0. ...

I divide by 10^5 and get a quotient of 100 and a remainder of 0.

Similar questions