Minggu, 21 Juni 2015

Membuat program deret sederhana










List Program
unit deret;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Edit1: TEdit;
    Memo1: TMemo;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  a,i,b:integer;
begin
  a:=strtoint(Edit1.Text);
  Memo1.Clear;
  i:=1;
  while i<=a do
  begin
    b:=i;
    Memo1.Lines.Add(inttostr(b));
    i:=i+1;
  end;
end;
end.

Hasil Running
















0 komentar:

Posting Komentar

Categories

Total Tayang

Jam

Kalender Islam

Diberdayakan oleh Blogger.

Popular Posts

Pengikut