I want to ask the user to write in an Integer(N) and then I display the 10-logarithm of the Integer he/she entered. I have successfully calculated the 10-logarithm but do not know how to display it like the following ex:
Write in an Integer: 455666
455666 / 10 = 45566
45566 / 10 = 4556
4556 / 10 = 455
455 / 10 = 45
45 / 10 = 4
Answer: 10-logarithm of 455666 is 5.
Here is my code:
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
with Ada.Float_Text_IO; use Ada.Float_Text_IO;
procedure Logarithm is
X: Integer;
begin
Put("Write in an Integer: ");
Get(X);
for I in 1..X loop
if 10**I<=X then
Put(I);
end if;
end loop;
end Logarithm;