Please open Telegram to view this post
VIEW IN TELEGRAM
👍2⚡1❤🔥1🔥1💯1🏆1🤓1
Please open Telegram to view this post
VIEW IN TELEGRAM
👍3🔥1🥰1👌1🏆1
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
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
Telegram
PROGRAMMERS
Guruh: @Cpp_java_dasturlash
Android: @prog_mz_android
Quiz bot: @programmersQuiz_bot
Portfolio: @ProgrammersPortfolio
Reklama: https://t.iss.one/programmers_reklama/2
Kanal uchun taklif:
@Mr_Max_Telegram
@ZohidAbdullayev
Android: @prog_mz_android
Quiz bot: @programmersQuiz_bot
Portfolio: @ProgrammersPortfolio
Reklama: https://t.iss.one/programmers_reklama/2
Kanal uchun taklif:
@Mr_Max_Telegram
@ZohidAbdullayev
🔥2👍1👏1🏆1👨💻1
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❤🔥1⚡1🐳1🏆1
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🤩2❤1👏1🐳1💯1🏆1👨💻1
Please open Telegram to view this post
VIEW IN TELEGRAM
⚡3❤🔥2🔥1👏1🐳1🏆1
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
👍3⚡1🔥1👏1🏆1
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
🔥3❤1👍1🥰1👏1
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
👍3❤2🥰1🐳1🏆1
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
Telegram
PROGRAMMERS
Guruh: @Cpp_java_dasturlash
Android: @prog_mz_android
Quiz bot: @programmersQuiz_bot
Portfolio: @ProgrammersPortfolio
Reklama: https://t.iss.one/programmers_reklama/2
Kanal uchun taklif:
@Mr_Max_Telegram
@ZohidAbdullayev
Android: @prog_mz_android
Quiz bot: @programmersQuiz_bot
Portfolio: @ProgrammersPortfolio
Reklama: https://t.iss.one/programmers_reklama/2
Kanal uchun taklif:
@Mr_Max_Telegram
@ZohidAbdullayev
🔥4👍2❤🔥1⚡1👏1🤓1
Please open Telegram to view this post
VIEW IN TELEGRAM
👍3🏆2❤1👏1🐳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