Skip to main content

Menentukan bilangan Genap dan Ganjil dengan Delphi

Menentukan bilangan  genap dan ganjil


emhh langsung saja..
Dalam program ini kita membagi inputan bilangan menjadi 2 dengan perintah :

if a mod 2 = 0

nah perintah mod  disini yaitu membagi bilangan.
langsung desain form nya saja.

Desain form :




selanjutnya rubah properties :



setelah dirubah propertiesnya :


nahh langsung aja kode program nya :)

untuk button 1 (keluar) :

procedure TForm1.Button1Click(Sender: TObject);
begin
close;
end;

untuk button 2 (proses) :


procedure TForm1.Button2Click(Sender: TObject);
var a : integer;
begin
a := strtoint(edit1.Text);

if a mod 2 =0 then
    begin
      label4.Caption:= 'Bilangan Anda Genap';
      end
     else
     label4.Caption:= 'Bilangan Anda Ganjil';
  end;

untuk button 3 (ulang) :

procedure TForm1.Button3Click(Sender: TObject);
begin
edit1.clear;
label4.Caption:='Hasil';
end;

nahh itu td programnya kalo anda ingin yg udah jadi download disini ....


Comments

Popular posts from this blog

Menampilkan Tanggal dan Waktu pada netbean

Selamat malam teman, malam ini saya akan memberikan bagaimana cara untuk menampilkan jam serta tanggal otomatis pada nnetbean : pertama kita buat sebuah jFrame  Form dengan 2 buah jLabel yaitu jLabel1 dan jLabel2. kemudian pada Source kita utak atik : kita import dahulu untuk jamnya :    kita tulis dibawah   :                                package form; import java.awt.event.ActionEvent; import java.awt.event.ActionListener;  import javax.swing.Timer;        Source utama : //untuk perintah penampilan tanggal public void setTanggal(){     java.util.Date skrg = new java.util.Date();     java.text.SimpleDateFormat kal = new     java.text.SimpleDateFormat("dd/MM/yyyy");     jLabel1.setText(kal.format(skrg));     }     //untuk perintah penampilan tanggal public void setJam(){ ActionListener taskPerformer = new ActionListener() { public void actionPerformed(ActionEvent evt) { String nol_jam = "", nol_menit = "",no

Installing and Using Blogger Templates Created with Artisteer

Hosting Images Blogger does not support uploading images directly to Blogspot accounts, so you will need to select one of methods available in Artisteer for hosting template's images externally. Artisteer provides three image hosting options which may be used depending on your reliability and performance requirements: Picasa Web Albums This service is used by default and is suitable in most cases as Picasa utilizes the same Google account used for Blogger and does not require additional registration or configuration. To set the hosting options navigate please File -> Export -> Options -> Image Hosting . NOTE: Picasa does not support large images being accessed from custom domains, therefore when hosting your blog on a custom domain (eg. www.<yourname>.com) Artisteer will instead upload larger images to free ImageShack image hosting service. This may occasionally result in slower performance, therefore custom domain owners may consi