You are on page 1of 4

LATIHAN 1

PRATIKUM VISAUL NET

Disusun Oleh :
202208 Baharuddin

PROGRAM STUDI TEKNIK INFORMATIKA


UNIVERSITAS DIPA MAKASSAR
2022
LISTING
/*
* Created by SharpDevelop.
* User: Bahar2
* Date: 4/21/2022
* Time: 12:14 PM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;

namespace latihan1
{
/// <summary>
/// Description of MainForm.
/// </summary>
public partial class MainForm : Form
{
public MainForm()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();

//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
void Button1Click(object sender, EventArgs e)
{
//penjumlahan
int text;
int box;
int jumlah;
text = int.Parse(textBox1.Text);
box = int.Parse(textBox2.Text);
textBox3.Text = Convert.ToString(jumlah=text+box);
}
void Button2Click(object sender, EventArgs e)
{
//pengurangan
int text;
int box;
int kurang;
text = int.Parse(textBox1.Text);
box = int.Parse(textBox2.Text);
textBox3.Text = Convert.ToString(kurang = text - box);
}
void Button3Click(object sender, EventArgs e)
{
//perkalian
int text;
int box;
int kali;
text = int.Parse(textBox1.Text);
box = int.Parse(textBox2.Text);
textBox3.Text = Convert.ToString(kali = text * box);
}
void Button4Click(object sender, EventArgs e)
{
//pembagian
int text;
int box;
int bagi;
text = int.Parse(textBox1.Text);
box = int.Parse(textBox2.Text);
textBox3.Text = Convert.ToString(bagi = text / box);
}

}
}
HASIL

You might also like