1.03K subscribers
1.77K photos
420 videos
676 files
3.85K links
Download Telegram
#javob
#case9
Kotlin dasturlash tilida

fun main() {
var d = readLine()!!.toInt()
var m = readLine()!!.toInt()
when (m) {
1, 3, 5, 7, 8, 10 -> {
if (d < 31) {
d++
print("$d $m")
} else if (d == 31) {
d = 1
m++
print("$d $m")
} else {
println("Bunday sana yo'q")
}
}
2 -> {
if (d < 28) {
d++
print("$d $m")
} else if (d == 28) {
d = 1
m++
print("$d $m")
} else {
println("Bunday sana yo'q")
}
}
4, 6, 9, 11 -> {
if (d < 30) {
d++
print("$d $m")
} else if (d == 30) {
d = 1
m++
print("$d $m")
} else {
println("Bunday sana yo'q")
}
}
12 -> {
if (d == 31) {
d = 1
m = 1
print("$d $m")
} else if (d < 31) {
d++
print("$d $m")
} else {
println("Bunday sana yo'q")
}
}
else -> println("Bunday oy yo'q")
}
}

Telegram | Viktorina bot | Portfolio
❀1πŸ₯°1🀩1
#javob_java_boolean_12

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int a = scanner.nextInt();
int b = scanner.nextInt();
int c = scanner.nextInt();
boolean bool = ((a > 0) && (b > 0) && (c > 0));
System.out.println(bool);
}

Telegram | Viktorina bot | Portfolio
πŸ‘1πŸ”₯1πŸ‘1
❀1πŸ‘1πŸ”₯1πŸ‘1
#javob
#gita_8
Java dasturlash tilida

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
float boshSumma = scanner.nextFloat();
float p = scanner.nextFloat();
float s = 2 * boshSumma;
int oy = 0;
while (s > boshSumma) {
boshSumma += boshSumma * (p / 100);
oy++;
}
System.out.print(oy + " oyda ");
System.out.printf("%.2f", boshSumma);
System.out.print(" so'm");
}

Telegram | Viktorina bot | Portfolio
❀1πŸ‘1πŸ‘1
❀1πŸ‘1πŸ₯°1
❀1πŸ‘1🀩1
PROGRAMMERS pinned a photo
πŸ‘1πŸ₯°1πŸ‘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 Kotlin bobining Begin bo'limini yakunladik.

Viktorina bot

Telegram | Viktorina bot | Portfolio
πŸ‘2❀1πŸ”₯1πŸ₯°1πŸ‘1
πŸ‘1πŸ”₯1πŸ₯°1🀩1
#savol
O’nlik sanoq sistemasidan ikkilik sanoq sistemasiga o’tish dasturini tuzing.

#javob
#java
Java dasturlash tilida

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("O'nlik sanoq sistemasida biror son kiriting: ");
int n = scanner.nextInt();
String b = Integer.toBinaryString(n);
System.out.println(n + " sonining ikkilikdagi ko'rinishi = " + b);
}

Telegram | Viktorina bot | Portfolio
πŸ‘1πŸ₯°1🀩1
#savol

#javob
Kotlin dasturlash tilida

print("A = ")
var a = readLine()!!.toInt()
print("B = ")
val b = readLine()!!.toInt()
while (a > b) {
a -= b
}
println("A kesmaning bo'sh qismi = $a")

Telegram | Viktorina bot | Portfolio
❀1πŸ‘1πŸ”₯1πŸ‘1🀩1
#javob_java_boolean_13

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int a = scanner.nextInt();
int b = scanner.nextInt();
int c = scanner.nextInt();
boolean bool = ((a > 0) (b > 0) (c > 0));
System.out.println(bool);
}

Telegram | Viktorina bot | Portfolio
❀1πŸ‘1πŸ”₯1πŸ‘1
❀1πŸ‘1πŸ₯°1🀩1
#savol
#if_19

#javob
#if_19
Kotlin dasturlash tilida

fun main() {
print("a = ")
val a = readLine()!!.toInt()
print("b = ")
val b = readLine()!!.toInt()
print("c = ")
val c = readLine()!!.toInt()
print("d = ")
val d = readLine()!!.toInt()
if (a == b && b == c && c != d) {
println(4)
} else if (a == b && b != c && b == d) {
println(3)
} else if (a != b && a == c && a == d) {
println(2)
} else if (a != b && b == c && b == d) {
println(1)
} else if (a == b && b == c && c == d) {
println("Bir xil sonlar")
} else {
println("Turli xil sonlar")
}
}

Telegram | Viktorina bot | Portfolio
❀1πŸ‘1πŸ”₯1πŸ₯°1πŸ‘1
#savol
#if_19

#javob
#if_19
Java dasturlash tilida

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("a = ");
int a = scanner.nextInt();
System.out.print("b = ");
int b = scanner.nextInt();
System.out.print("c = ");
int c = scanner.nextInt();
System.out.print("d = ");
int d = scanner.nextInt();
if (a == b && b == c && c != d) {
System.out.println(4);
} else if (a == b && b != c && b == d) {
System.out.println(3);
} else if (a != b && a == c && a == d) {
System.out.println(2);
} else if (a != b && b == c && b == d) {
System.out.println(1);
} else if (a == b && b == c && c == d) {
System.out.println("Bir xil sonlar");
} else {
System.out.println("Turli xil sonlar");
}
}

Telegram | Viktorina bot | Portfolio
❀1πŸ‘1πŸ‘1
#javob_java_boolean_14

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int a = scanner.nextInt();
int b = scanner.nextInt();
int c = scanner.nextInt();
boolean bool = ((a > 0) && (b < 0) && (c < 0)) ((a < 0) && (b > 0) && (c < 0)) ((a < 0) && (b < 0) && (c > 0));
System.out.println(bool);
}

Telegram | Viktorina bot | Portfolio
πŸ‘1πŸ”₯1πŸ‘1
πŸ”₯1πŸ‘1🀩1
#savol
#if_23

#javob
#if_23
C++ dasturlash tilida

#include <iostream>

using namespace std;

int main(){
int x1, x2, x3, x4, y1, y2, y3, y4;
cout << "x1 = ";
cin >> x1;
cout << "y1 = ";
cin >> y1;
cout << "x2 = ";
cin >> x2;
cout << "y2 = ";
cin >> y2;
cout << "x3 = ";
cin >> x3;
cout << "y3 = ";
cin >> y3;

if (x1 == x2) {
x4 = x3;
} else if (x1 == x3) {
x4 = x2;
} else if (x2 == x3) {
x4 = x1;
}

if (y1 == y2) {
y4 = y3;
} else if (y2 == y3) {
y4 = y1;
} else if (y1 == y3) {
y4 = y2;
}
cout << "(" << x4 << ";" << y4 << ")";
}

Telegram | Viktorina bot | Portfolio
πŸ‘2❀1πŸ”₯1πŸ₯°1
#savol
#if_23

#javob
#if_23
Java dasturlash tilida

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("x1 = ");
int x1 = scanner.nextInt();
System.out.print("y1 = ");
int y1 = scanner.nextInt();
System.out.print("x2 = ");
int x2 = scanner.nextInt();
System.out.print("y2 = ");
int y2 = scanner.nextInt();
System.out.print("x3 = ");
int x3 = scanner.nextInt();
System.out.print("y3 = ");
int y3 = scanner.nextInt();
int x4 = 0, y4 = 0;
if (x1 == x2) {
x4 = x3;
} else if (x1 == x3) {
x4 = x2;
} else if (x2 == x3) {
x4 = x1;
}

if (y1 == y2) {
y4 = y3;
} else if (y2 == y3) {
y4 = y1;
} else if (y1 == y3) {
y4 = y2;
}
System.out.println("(" + x4 + ";" + y4 + ")");
}

Telegram | Viktorina bot | Portfolio
πŸ‘3❀1πŸ”₯1πŸ₯°1
#javob_java_boolean_15

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int a = scanner.nextInt();
int b = scanner.nextInt();
int c = scanner.nextInt();
boolean bool = ((a > 0) && (b > 0) && (c < 0)) ((a < 0) && (b > 0) && (c > 0)) ((a > 0) && (b < 0) && (c > 0));
System.out.println(bool);
}

Telegram | Viktorina bot | Portfolio
πŸ‘2❀1πŸ‘1