private void button_Click ( object sender, EventArgs e)
{
int n= int.Parse (textBox1.Text);
int x= int.Parse (textBox2.Text);
int s=1;
//Prvo ispisujemo da li je n prirodan broj
if (n<0)
MessageBox.Show("Broj n mora biti prirodan!");
textBox1.Text= " " ;
}
//Ukoliko je n prirodan broj,mozemo da odredimo stepen broja x
else
for (int i=1; i<= n;i++)
s=s * x;
label1.Text= "x^n =" + s;