1-topshiriq to’g’ri burchakli uchburchakning a va


Uchta son berilgan. Bu sonning EKUB va EKUKini topish dasturini tuzing. (3 ta Label, 3 ta TextBox, 1 ta Button. Natija 2 ta Labelda chop etilsin)


Download 49.33 Kb.
bet12/17
Sana21.04.2023
Hajmi49.33 Kb.
#1373416
1   ...   9   10   11   12   13   14   15   16   17
Bog'liq
dasturlash

11. Uchta son berilgan. Bu sonning EKUB va EKUKini topish dasturini tuzing. (3 ta Label, 3 ta TextBox, 1 ta Button. Natija 2 ta Labelda chop etilsin)
12. Butun A va B sonlar berilgan. A dan B gacha sonlarning yig’indisini topish dastur tuzing. (2 ta Label, 2 ta TextBox, 1 ta Button. Natija Labelda chop etilsin)
13. N natural son berilgan. N natural sonigacha a ga bo’linuvchi sonlarni ListBoxga
joylashtiring
14. y=2x+19 funksiyaning qiymatini x ning [0;10] oraliqdagi 0.25 qadami bilan hisoblang
15. Natural sonining barcha toq bo’luvchilarini ListBoxga chiqaring.
if (e->KeyChar == 13) this->btnClickGenerate();
}
private: void btnClickGenerate() {
listBox1->Items->Clear();
for (long int i = Convert::ToInt64(numericUpDown1->Text); i > 0; i--) {
if (Convert::ToInt64(numericUpDown1->Text) % i == 0 && i % 2 == 1)
listBox1->Items->Add(i);
}


  1. Ikki xonali natural sonlar ichidan raqamlar yig’indisi juft bo’lgan sonlarni ListBoxga chiqaring

int a1, a2, i;
for (i = 10; i <= 99; i++) {
a1 = i % 10;
a2 = i / 10;
if ((a1 + a2) % 2 == 0) {
listBox1->Items->Add(Convert::ToString(i));
}
}
if(listBox1->Items->Count==0)
MessageBox::Show("Juft emas !!! \n \nIltimos ma'lumotni
tekshiring !!!", "ULMASSON Server:: ERROR", MessageBoxButtons::OK);
}

17. ListBoxda N ta son berilgan. Bu sonlar ichida max+min yig’indini Labelda chop eting
18. ListBoxda N natural son berilgan. Ikkinchi ListBoxda ularni M% ga oshirib natijasini chop eting.
Random ^n = gcnew Random();
for (int i = 0; i < 10; i++)
{
listBox1->Items->Add(Convert::ToString(n->Next(10,
200)));
}
Random ^m = gcnew Random();
for (int i = 0; i < 1; i++){
listBox2->Items->Add(Convert::ToString(m->Next(0,
100)));
}
}
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^
e) {
int res;
//n = Convert::ToInt32(listBox1->Items[0]);
//m = Convert::ToInt32(listBox2->Items[0]);
//int res = n + ((m*n) / 100);
for (int i = 0; i < listBox1->Items->Count; i++)
{
res = Convert::ToInt32(listBox1->Items[i]) +
((Convert::ToInt32(listBox1->Items[i])*Convert::ToInt32(listBox1->Items[i])) /
100);
listBox3->Items->Add(Convert::ToString(res));
}


Download 49.33 Kb.

Do'stlaringiz bilan baham:
1   ...   9   10   11   12   13   14   15   16   17




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling