- 6 İŞLEM YAPABILEN HESAP MAKINESI ( TOPLAMA, CIKARMA ,BOLME ,CARPMA,UST ALMA VE KOK BULMA ) -
C#
ALT PROGRAMLA (VOID) YAPILMIS HESAP MAKINESI KODLARIDIR...
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms;
namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } void topla() { int a, b, c; a = Convert.ToInt16(textBox1.Text); b = Convert.ToInt16(textBox2.Text); c = a + b; MessageBox.Show(c.ToString()); } void çıkar() { int a, b, c; a = Convert.ToInt16(textBox1.Text); b = Convert.ToInt16(textBox2.Text); c = a - b; MessageBox.Show(c.ToString()); }
void çarp() { int a, b, c; a = Convert.ToInt16(textBox1.Text); b = Convert.ToInt16(textBox2.Text); c = a * b; MessageBox.Show(c.ToString()); }
void böl() { int a, b, c; a = Convert.ToInt16(textBox1.Text); b = Convert.ToInt16(textBox2.Text); c = a / b; MessageBox.Show(c.ToString()); }
void ust() { int a, b, c=1,i; a = Convert.ToInt16(textBox1.Text); b = Convert.ToInt16(textBox2.Text); for (i = 0; i < b; i++)
c = c * a; MessageBox.Show(c.ToString()); } void kök() { int a,b; a = Convert.ToInt16(textBox1.Text); b = a; textBox2.Text=(Math.Sqrt(a).ToString()); }
2 TEXTBOX
- 6 İŞLEM YAPABILEN HESAP MAKINESI ( TOPLAMA, CIKARMA ,BOLME ,CARPMA,UST ALMA VE KOK BULMA ) -
C#
ALT PROGRAMLA (VOID) YAPILMIS HESAP MAKINESI KODLARIDIR...
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
void topla()
{
int a, b, c;
a = Convert.ToInt16(textBox1.Text);
b = Convert.ToInt16(textBox2.Text);
c = a + b;
MessageBox.Show(c.ToString());
}
void çıkar()
{
int a, b, c;
a = Convert.ToInt16(textBox1.Text);
b = Convert.ToInt16(textBox2.Text);
c = a - b;
MessageBox.Show(c.ToString());
}
void çarp()
{
int a, b, c;
a = Convert.ToInt16(textBox1.Text);
b = Convert.ToInt16(textBox2.Text);
c = a * b;
MessageBox.Show(c.ToString());
}
void böl()
{
int a, b, c;
a = Convert.ToInt16(textBox1.Text);
b = Convert.ToInt16(textBox2.Text);
c = a / b;
MessageBox.Show(c.ToString());
}
void ust()
{
int a, b, c=1,i;
a = Convert.ToInt16(textBox1.Text);
b = Convert.ToInt16(textBox2.Text);
for (i = 0; i < b; i++)
c = c * a;
MessageBox.Show(c.ToString());
}
void kök()
{
int a,b;
a = Convert.ToInt16(textBox1.Text);
b = a;
textBox2.Text=(Math.Sqrt(a).ToString());
}
private void button1_Click(object sender, EventArgs e)
{
topla() ;
}
private void button2_Click(object sender, EventArgs e)
{
çıkar();
}
private void button3_Click(object sender, EventArgs e)
{
çarp();
}
private void button4_Click(object sender, EventArgs e)
{
böl();
}
private void button5_Click(object sender, EventArgs e)
{
ust();
}
private void button6_Click(object sender, EventArgs e)
{
kök();
}
private void button7_Click(object sender, EventArgs e)
{
[b]www.becu.tr.gg
}
}
}