Factorial nomli rekursiv funksiya tuzing. X sonini quyidagi formula yordamida hisoblovchi Formula
Download 53.48 Kb.
|
algoritm 29-talik topshiriq javoblari
fasllar nomli tur yarating. swich-case yordamida yil fasllariga qaysi oylar to`g`ri kelishini chiqaruvchi dastur tuzing.
15-savol
enum Hafta_Kunlari { Dushanba, Seshanba, Chorshanba, Payshanba, Juma, Shanba, Yakshanba } class Program { static void Main(string[] args) { Hafta_Kunlari dayOfWeek = Hafta_Kunlari.Seshanba; switch (dayOfWeek) { case Hafta_Kunlari.Shanba: case Hafta_Kunlari.Yakshanba: Console.WriteLine("Dam olish kuni"); break; default: Console.WriteLine("Ish kuni"); break; } } } 16-savol
struct Talabalar
class Program { static void Main(string[] args) { Talabalar[] talabalar = new Talabalar[4]; // 4 ta talabaning 1-semestrda olgan ballarini kiritish talabalar[0].ism_familiya = "Alijonov Alisher"; talabalar[0].ball = 85.5; talabalar[1].ism_familiya = "Qodirov Qodir"; talabalar[1].ball = 69.5; talabalar[2].ism_familiya = "Hakimova Hafiza"; talabalar[2].ball = 92.0; talabalar[3].ism_familiya = "Rasulov Asror"; talabalar[3].ball = 78.0; // 70% dan baland bo`lgan talabalar ism familiyasi ekranga chiqariladi foreach (Talabalar talaba in talabalar) { if (talaba.ball >= 70) { Console.WriteLine(talaba.ism_familiya); } } Console.ReadKey(); } } 17-savol
Download 53.48 Kb. Do'stlaringiz bilan baham: |
ma'muriyatiga murojaat qiling