1.02K subscribers
1.77K photos
420 videos
676 files
3.85K links
Download Telegram
Kotlin dasturlash tilida faqat Reference (non primitive) toifa mavjud

Reference toifaga misollar - Byte, Short, Int, Long, Float, Double, Boolean, Char, String, Array, Classe, Interface

Telegram | ViktorinBot | Portfolio | YouTube
👍1🔥1🏆1
#javob_java_case_18

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("(100 - 999) oralig'ida son kiriting: ");
int n = scanner.nextInt();
int a = n / 100;
int b = (n / 10) % 10;
int c = n % 10;
switch (a) {
case 1 -> System.out.print("bir yuz");
case 2 -> System.out.print("ikki yuz");
case 3 -> System.out.print("uch yuz");
case 4 -> System.out.print("to'rt yuz");
case 5 -> System.out.print("besh yuz");
case 6 -> System.out.print("olti yuz");
case 7 -> System.out.print("yetti yuz");
case 8 -> System.out.print("sakkiz yuz");
case 9 -> System.out.print("to'qqiz yuz");
}
switch (b) {
case 1 -> System.out.print(" o'n ");
case 2 -> System.out.print(" yigirma ");
case 3 -> System.out.print(" o'ttiz ");
case 4 -> System.out.print(" qirq ");
case 5 -> System.out.print(" ellik ");
case 6 -> System.out.print(" oltmish ");
case 7 -> System.out.print(" yetmish ");
case 8 -> System.out.print(" sakson ");
case 9 -> System.out.print(" to'qson ");
}
switch (c) {
case 1 -> System.out.println("bir");
case 2 -> System.out.println("ikki");
case 3 -> System.out.println("uch");
case 4 -> System.out.println("to'rt");
case 5 -> System.out.println("besh");
case 6 -> System.out.println("olti");
case 7 -> System.out.println("yetti");
case 8 -> System.out.println("sakkiz");
case 9 -> System.out.println("to'qqiz");
}
}

Telegram | Viktorina bot | Portfolio | YouTube
👍5
👍5
👍21😁1🏆1
#savol_java_case_19

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int year = scanner.nextInt();
year -= 1983;
year %= 60;
int colour = year % 5;
int animal = year % 12;
switch (colour) {
case 0 -> System.out.print("Qora ");
case 1 -> System.out.print("Yashil ");
case 2 -> System.out.print("Qizil ");
case 3 -> System.out.print("Sariq ");
case 4 -> System.out.print("Oq ");
}
switch (animal) {
case 0 -> System.out.print("To`ng`iz ");
case 1 -> System.out.print("Sichqon ");
case 2 -> System.out.print("Sigir ");
case 3 -> System.out.print("Yo`lbars ");
case 4 -> System.out.print("Quyon ");
case 5 -> System.out.print("Ajdar ");
case 6 -> System.out.print("Ilon ");
case 7 -> System.out.print("Ot ");
case 8 -> System.out.print("Qo`y ");
case 9 -> System.out.print("Maymun ");
case 10 -> System.out.print("Tovuq ");
case 11 -> System.out.print("It ");
}
System.out.println("yili");
}

Telegram | Viktorina bot | Portfolio | YouTube
👍3
👍3😁1
👍2🥰1
👍2👏1
1👍1🏆1
#javob_kotlin_case_1

fun main() {
val scanner = Scanner(System.in)
print("n = ")
when (scanner.nextInt()) {
1 -> println("Dushanba")
2 -> println("Seshanba")
3 -> println("Chorshanba")
4 -> println("Payshanba")
5 -> println("Juma")
6 -> println("Shanba")
7 -> println("Yakshanba")
else -> println("Bunday kun yo'q")
}
}

Telegram | Viktorina bot | Portfolio | YouTube
👨‍💻21👍1
🔥2👍1🤓1
#savol

a, b, c butun sonlar berilgan. b soni a va c sonlari orasida yotadi

Telegram | ViktorinBot | Portfolio | YouTube
👍3🔥1🥰1👏1
#savol

a, b, c butun sonlar berilgan. b soni a va c sonlari orasida yotadi

Telegram | ViktorinBot | Portfolio | YouTube
👍2🔥1👏1
#javob_kotlin_case_2

fun main() {
val scanner = Scanner(System.in)
print("n = ")
when (scanner.nextInt()) {
1 -> println("Yomon")
2 -> println("Qoniqarsiz")
3 -> println("Qoniqarli")
4 -> println("Yaxshi")
5 -> println("A'lo")
else -> println("Xato")
}
}

Telegram | Viktorina bot | Portfolio | YouTube
👍2🤩1
Assalomu aleykum Xurmatli dasturchilar.

PROGRAMMERS kanalimizda savol - javob viktorinasini olib borayapmiz. Viktorinamizda berilayotgan savollar va javobllar yuqorida qolib ketganligini hisobga olgan holatda, viktorinamizdagi savol javoblarni @programmersQuiz_bot botiga joylab borayapmiz. Botga a'zo bo'ling. Hali savollar oldida ...

Botdagi Java bobiga yangi If bo'limini qo'shdik.

Viktorina bot

Telegram | ViktorinBot | Portfolio | YouTube
👍2❤‍🔥1👏1
🔥211👍1
1👍1🔥1
2👏1🏆1
#javob_kotlin_case_3

fun main() {
val scanner = Scanner(System.in)
print("n = ")
when (scanner.nextInt()) {
12, 1, 2 -> println("Qish")
3, 4, 5 -> println("Bahor")
6, 7, 8 -> println("Yoz")
9, 10, 11 -> println("Kuz")
else -> println("Xato")
}
}

Telegram | Viktorina bot | Portfolio | YouTube
👍31👏1