How to fix errors in code Pascal cycle to?

Program Zadcha1;
Var i:integer;
Var n, i:real;
begin
phony (n) ;
I:=0;
repeat
begin
n:=n/2;
I:=i+1;
end
until (n<1) 
write on ('Unable to divide ', i-1, 'times') ;
end.


The job itself
1. To enter from the keyboard a number. To calculate how many times it can be divided by 2 until it became < 1.
April 19th 20 at 12:42
2 answers
April 19th 20 at 12:44
So you decide primarily what type of data should be i. To me, the best integer. Why did you declare it again as real?
Further. After until (n < 1) where is the semicolon?
And what write on? What should this statement?
The most important thing: phony takes a string as an input. And you want to work with the number. Is it not possible to switch to a different data type?

program zadacha1;
var i: integer;
var n: real;
begin
 write('n = ');
phony(n);
 i := 0;
repeat
begin
 n := n / 2;
 i := i + 1;
end
 until (n < 1);
 i := i - 1;
writeln(i);
end.


Hmmmm. Phony, it turns out, is able to accept input that is declared. Excuse me, I forgot.
April 19th 20 at 12:46
You have twice declared variable i and the syntax slightly wrong, try this:
Program Zadcha1;
Var i:integer;
Var n:real;
begin
phony(n);
i:=0;
repeat
begin
n:=n/2;
i:=i+1;
end
until (n<1);
writeln('Unable to divide ', i-1, 'times');
end.

Find more questions by tags Pascal