1.01K subscribers
1.77K photos
420 videos
678 files
3.85K links
Download Telegram
Please open Telegram to view this post
VIEW IN TELEGRAM
👍21❤‍🔥1🔥1💯1🏆1🤓1
Please open Telegram to view this post
VIEW IN TELEGRAM
👍3🔥1🥰1👌1🏆1
✔️ #javob_java_if_24

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("x = ");
float x = scanner.nextFloat();
if (x > 0) {
System.out.println(2 * Math.sin(x));
} else {
System.out.println(x-6);
}
}

Telegram | Viktorina bot | Portfolio
Please open Telegram to view this post
VIEW IN TELEGRAM
👍3🤩1👌1🤓1👨‍💻1
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥2👍1🥰1👏1🐳1
#savol
isDigit nomli funksiyasi yarating va parametrga String ko'rinishida satr berilgan bo'lsin. Satr tarkibida raqam bor yoki yo'qligi topuvchi dastur tuzing. Agar satr tarkibida son bo'lsa true, aks holda false qiymat qaytaring?

#javob
#isDigit
Java dasturlash tilida

public class isDigitFunction {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println(isDigit(scanner.nextLine()));
}

private static boolean isDigit(String str){
for (int i = 0; i < str.length(); i++) {
char ch = str.charAt(i);
if (ch >= 48 && ch <= 57){
return true;
}
}
return false;
}
}

Telegram | Viktorina bot | Portfolio
🔥2👍1👏1🏆1👨‍💻1
✔️ #javob_java_if_25

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("x = ");
float x = scanner.nextFloat();
if (x < -2 || x > 2) {
System.out.println(2 * x);
} else {
System.out.println(-3 * x);
}
}

Telegram | Viktorina bot | Portfolio
Please open Telegram to view this post
VIEW IN TELEGRAM
👍4👏2❤‍🔥1🏆1👨‍💻1
Please open Telegram to view this post
VIEW IN TELEGRAM
👍4🔥2❤‍🔥11🐳1🏆1
✔️ #javob_java_if_26

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("x = ");
float x = scanner.nextFloat();
if (x <= 0) {
System.out.println(-x);
} else if (x > 0 && x < 2) {
System.out.println(x * x);
} else {
System.out.println(4);
}
}

Telegram | Viktorina bot | Portfolio
Please open Telegram to view this post
VIEW IN TELEGRAM
👍4🤩21👏1🐳1💯1🏆1👨‍💻1
Please open Telegram to view this post
VIEW IN TELEGRAM
3❤‍🔥2🔥1👏1🐳1🏆1
✔️ #javob_java_if_27

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("x = ");
float x = scanner.nextFloat();
if (x < 0) {
System.out.println(0);
} else if ((int) x % 2 == 0) {
System.out.println(1);
} else {
System.out.println(-1);
}
}

Telegram | Viktorina bot | Portfolio
Please open Telegram to view this post
VIEW IN TELEGRAM
👍2❤‍🔥1🔥1👏1🏆1
Please open Telegram to view this post
VIEW IN TELEGRAM
👍31🔥1👏1🏆1
✔️ #javob_java_if_28

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("n = ");
int n = scanner.nextInt();
if (n % 4 == 0 && n % 100 != 0 || n % 400 == 0) {
System.out.println(366);
} else
System.out.println(365);
}

Telegram | Viktorina bot | Portfolio
Please open Telegram to view this post
VIEW IN TELEGRAM
2❤‍🔥1🔥1💯1👨‍💻1
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥31👍1🥰1👏1
#savol

#javob
#for17
Kotlin dasturlash tilida

fun main() {
val scanner = Scanner(System.in)
print("n = ")
val n = scanner.nextInt()
print("a = ")
val a = scanner.nextFloat()
var s = 1
var t = 1
for (i in 0 until n) {
t *= a.toInt()
s += t
}
println(s)
}

Telegram | Viktorina bot | Portfolio
👍32🔥1👏1🏆1🤓1
✔️ #javob_java_if_29

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("n = ");
int n = scanner.nextInt();
if (n % 2 == 0 && n > 0) {
System.out.println("Musbat juft son");
} else if (n % 2 != 0 && n > 0) {
System.out.println("Musbat toq son");
} else if (n % 2 != 0) {
System.out.println("Manfiy toq son");
} else if (n < 0) {
System.out.println("Manfiy juft son");
} else {
System.out.println("Nolga teng");
}
}

Telegram | Viktorina bot | Portfolio
Please open Telegram to view this post
VIEW IN TELEGRAM
👍3🔥1🥰1👏1🏆1
Please open Telegram to view this post
VIEW IN TELEGRAM
👍32🥰1🐳1🏆1
✔️ #javob_java_if_30

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("1 - 999 oraliqdagi son kiriting: ");
int n = scanner.nextInt();
if (n % 2 == 0 && n > 9 && n < 100) {
System.out.println("Ikki xonali juft son");
} else if (n % 2 != 0 && n > 9 && n < 100) {
System.out.println("Ikki xonali toq son");
} else if (n % 2 != 0 && n > 99 && n < 1000) {
System.out.println("Uch xonali toq son");
} else {
System.out.println("Uch xonali juft son");
}
}

Telegram | Viktorina bot | Portfolio
Please open Telegram to view this post
VIEW IN TELEGRAM
👍3🔥1👏1🏆1👨‍💻1
⚠️⚠️⚠️

PROGRAMMERS kanalimizda Qudrat Abdurahimov tomonlaridan tayyorlangan dastur uz masalalar to'plamini C++, Java, Kotlin dasturlash tillarida ishlab kelmoqdamiz. 21.12.2022 (Chorshanba) kuni, Java dasturlash tilida Shart operatoriga oid masalalar (if) bo'limini yakunladik

Ertadan 22.12.2022 (Payshanba) kunidan boshlab, Kotlin dasturlash tilida If (shart operatori) bo'limini boshlaymiz.

Misollar tartibi quyidagicha.
Har kuni kanalga ertalab 8:00 da savol va 20:00 da savolning javoblarini joylab boramiz

Telegram | Viktorina bot | Portfolio
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥4👍2❤‍🔥11👏1🤓1
Please open Telegram to view this post
VIEW IN TELEGRAM
👍3🏆21👏1🐳1
✔️ #javob_kotlin_if_1

fun main() {
val scanner = Scanner(System.in)
print("n = ")
var n: Int = scanner.nextInt()
if (n > 0) {
println(++n)
} else {
println(n)
}
}

Telegram | Viktorina bot | Portfolio
Please open Telegram to view this post
VIEW IN TELEGRAM
👍3❤‍🔥2🏆1👨‍💻1
Please open Telegram to view this post
VIEW IN TELEGRAM
👍1🔥1🥰1👏1🏆1