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 Soru_2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int usHesapla(int taban, int us)
{
int sonuc = 1;
for (int i = 0; i < us; i++)
{
sonuc *= taban;
}
return sonuc;
}
private void button1_Click(object sender, EventArgs e)
{
int sonuc = 0;
if (txtUs.Text == "")
{
sonuc = usHesapla(int.Parse(txtTaban.Text), 2);
}
else
{
sonuc = usHesapla(int.Parse(txtTaban.Text), int.Parse(txtUs.Text));
}
lblSonuc.Text = "Sonuç : " + sonuc.ToString();
}
}
}
0 yorum:
Yorum Gönder