4-LABARATORIYA
private: System::Void Button1_Click_1(System::Object^ sender, System::EventArgs^ e)
{
double a, b;
a = Convert::ToDouble(this->textBox1->Text);
b = Convert::ToDouble(this->textBox2->Text);
this->label5->Text = Convert::ToString(Math::Sqrt(a * a + b * b));
}
private: System::Void Button2_Click(System::Object^ sender, System::EventArgs^ e)
{
double a, b, c;
a = Convert::ToDouble(this->textBox1->Text);
b = Convert::ToDouble(this->textBox2->Text);
c = Math::Sqrt(a * a + b * b);
this->label6->Text = Convert::ToString(a + b + c);
}
private: System::Void Button3_Click(System::Object^ sender, System::EventArgs^ e)
{
char k1;
int k2;
k2 = Convert::ToInt32(textBox4->Text);
k1 = Convert::ToChar(textBox3->Text);
switch (k1)
{
case 's':this->label8->Text = "Robotning yunalishi : Shimol "; break;
case 'j':this->label8->Text = "Robotning yunalishi : Janub "; break;
case 'q':this->label8->Text = "Robotning yunalishi : Sharq "; break;
case 'g':this->label8->Text = "Robotning yunalishi : G`arb "; break;
}
switch (k2)
{
case 0:this->label8->Text = label8->Text + "o`ngga buril "; break;
case 1:this->label8->Text = label8->Text + "chapga buril "; break;
case 2:this->label8->Text = label8->Text + "burilish 180 C "; break;
}}
|
5-LABARATORIYA
private: System::Void Button1_Click(System::Object^ sender, System::EventArgs^ e)
{
int s = 0;
for (int i = 2; ; i++)
{
int p = 0;
for (int j = 1; j <= i; j++)
{
if (i % j == 0)
{
p++;
}
}
if (p <= 2)
{
this->listBox1->Items->Add(i);
s++;
}
if (s == Convert::ToInt32(textBox1->Text)) { break; }
}
}
|
6-LABARATORIYA
Do'stlaringiz bilan baham: |