like I wrote in the title, I would like to know how to find a number inside another number and show at which decimal place the number occurs?
We have the number PI:
And then we have another number, for example this one:
Now I want to know on which decimal place exactly this number occurs
The Answer is: 1-5
Because the number we are looking for is showing up on the first decimal place and end on the fifth decimal place. As you can see here:
I would like to write a small program with an input field and an output field
Input: Type in any number
Output: Show at what decimal place the number occurs
The funny thing is that I think it should be not that hard to program a query to find the numbers easily. However I dont know where to start…
I guess we need to make a
const Pi and then we need to define a random number
let OtherNumber. We loop though
const PI and check
if (if statement) the random number we need to loop though is somewhere available inside of the number PI.
Then we need to declare that
if (if Statement) this number is showing up then display the decimal place at one which the number occurs.
These are my thoughts right now and I would really aprechiate if someone with more experience can let me know his / her thought process.
Thanks for answers!