unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, System.ComponentModel, Borland.Vcl.StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    procedure Button4Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.nfm}

procedure TForm1.Button1Click(Sender: TObject);
var i :Byte;
begin
for i:=1 to 10 do Windows.Beep(100*i,100);
for i:=10 downto 1 do Windows.Beep(100*i,100);
end;

procedure TForm1.Button2Click(Sender: TObject);
var
  d :Double;
  i :Integer;
begin
i:=0; d:=1;
//d:=1E-7;
repeat
  d:=d/2;
  Inc(i);
until d<1E-6;
ShowMessage('d='+FloatToStr(d)+', i='+IntToStr(i));
end;

procedure TForm1.Button3Click(Sender: TObject);
var
  d :Double;
  i :Integer;
begin
i:=0; d:=1;
//d:=1E-7;
while not (d<1E-6) do
  begin
  d:=d/2;
  Inc(i);
  end;
ShowMessage('d='+FloatToStr(d)+', i='+IntToStr(i));
end;



procedure TForm1.Button4Click(Sender: TObject);
var
  i :Shortint;
  n :Byte;
begin
n:=0;
for i:=-10 to 10 do
  begin
  if i=0 then Continue;
  if 100 mod i=0 then
    begin
    Inc(n);
    ShowMessage(IntToStr(n)+'. 100/('+IntToStr(i)+')='+IntToStr(100 div i)+', bez reszty');
    //if n=3 then Break;
    end;
  end;
ShowMessage('Znaleziono '+IntToStr(n)+' liczb(y)');
end;

end.
