✨ WAP to in input a number and if it is odd number by 10 otherwise multiply the number by 5 display the result. ✨
Answers
Answer:
As in this case you want to print digit in tenth position.
As in this case you want to print digit in tenth position.Second Multiply the position by 10. In this case it will become 100
As in this case you want to print digit in tenth position.Second Multiply the position by 10. In this case it will become 100Now Perform the following operation : reminder = number % 100
As in this case you want to print digit in tenth position.Second Multiply the position by 10. In this case it will become 100Now Perform the following operation : reminder = number % 100now divide the reminder by the position you want(in this case it is 10)
As in this case you want to print digit in tenth position.Second Multiply the position by 10. In this case it will become 100Now Perform the following operation : reminder = number % 100now divide the reminder by the position you want(in this case it is 10)digit = reminder / 10
As in this case you want to print digit in tenth position.Second Multiply the position by 10. In this case it will become 100Now Perform the following operation : reminder = number % 100now divide the reminder by the position you want(in this case it is 10)digit = reminder / 10Hurrah!!!! You get the digit.
As in this case you want to print digit in tenth position.Second Multiply the position by 10. In this case it will become 100Now Perform the following operation : reminder = number % 100now divide the reminder by the position you want(in this case it is 10)digit = reminder / 10Hurrah!!!! You get the digit.Example: number = 12345
As in this case you want to print digit in tenth position.Second Multiply the position by 10. In this case it will become 100Now Perform the following operation : reminder = number % 100now divide the reminder by the position you want(in this case it is 10)digit = reminder / 10Hurrah!!!! You get the digit.Example: number = 123451. digit at tenth position
As in this case you want to print digit in tenth position.Second Multiply the position by 10. In this case it will become 100Now Perform the following operation : reminder = number % 100now divide the reminder by the position you want(in this case it is 10)digit = reminder / 10Hurrah!!!! You get the digit.Example: number = 123451. digit at tenth position= (number % 100 ) / 10
= (12345 % 100 )/10
= (12345 % 100 )/10= 4
= (12345 % 100 )/10= 42. digit at hundredth position
= (number % 1000 ) / 100
= (12345 % 1000)/100
(12345 % 1000)/100= 3