Asqarov Shohjahon 051-21 1-Amaliy topshiriq
Download 0.62 Mb. Pdf ko'rish
|
1 - topshiriq Shohjahon
- Bu sahifa navigatsiya:
- 17- variant 1-topshiriq 17 { ; include include using namespace std; int main()
17- variant 1-topshiriq 17 { ; #include #include using namespace std; int main() { float b, x, Z; int a; cout << "Asqarov Shohjahon" << endl; cout << "a b x ni kiriting" << endl; cin >> a >> b >> x; if (a >= 0) Z = (7 * (x * x)) - (3 * a * b)-(5 * a * b); else if (a < 0) Z = (15 * a) - (7 * b); cout << "Natija Y = " << Z; } 2 – topshiriq Case17. O’quv masalalarini raqamini aniqlovchi 10-50 gacha butun son berilgan. Son kirirtilganda masala raqamini unga mos so’zlarda ifodalovchi dastur tuzilsin. (“yigirmanchi masala”, “o’ttiz beshinchi masala” va hk) #include #include using namespace std; int main() { int son; cout << "Asqarov Shohjahon" << endl; cout << "sonni kiriting = "; cin >> son; int raq1, raq2; raq1 = son / 10; raq2 = son % 10; switch(raq1) { case 1:{ cout << "o'n "; break; } case 2:{ cout << "yigirma "; break; } case 3:{ cout << "o'ttiz "; break; } case 4:{ cout << "qirq "; break; } case 5:{ cout << "ellik "; break; } } switch(raq2) { case 0:{ cout <<"inchi masala"; break; } case 1:{ cout << "birinchi masala"; break; } case 2:{ cout << "ikkinchi masala"; break; } case 3:{ cout << "uchinchi masala"; break; } case 4:{ cout << "to'rtinchi masala"; break; } case 5:{ cout << "beshinchi masala"; break; } case 6:{ cout << "oltinchi masala"; break; } case 7:{ cout << "yettinchi masala"; break; } case 8:{ cout << "sakkizinchi masala"; break; } case 9:{ cout << "to'qqizinchi masala"; break; } } } Download 0.62 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling