Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Program Lab;
- Uses
- System.SysUtils;
- Var
- NumM, NumK, Num: Integer;
- IsCorrect: Boolean;
- Begin
- Num := 4;
- Writeln('Given an integer m > 10. Find the largest integer k for which 4^k <
- m.');
- Write('Enter an integer (>10): ');
- Repeat
- Try
- IsCorrect := True;
- Read(NumM);
- If (NumM < 10) Then
- Begin
- IsCorrect := False;
- Write('A value less than ten was entered. Enter a valid value: ');
- End;
- Except
- Begin
- Write('Symbols have been entered. Enter the number: ');
- IsCorrect := False;
- End;
- End;
- Until IsCorrect;
- While Num < NumM Do
- Begin
- Num := Num * 4;
- Inc(NumK);
- End;
- Write(NumK);
- End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement