1.02K subscribers
1.77K photos
420 videos
676 files
3.85K links
Download Telegram
#javob_java_boolean_37

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();
double d = Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(x2 - y2, 2));
System.out.println(d < 2);
}

Telegram | Viktorina bot | Portfolio
👍21🔥1🥰1👏1😁1🎉1
1🔥1🥰1
Kompyuter savodxonligi.pdf
4.5 MB
👍21🥰1🤩1
#javob_java_boolean_38

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();
boolean fil = ((Math.abs(x1 - x2)) == (Math.abs(y1 - y2)));
System.out.println(fil);
}

Telegram | Viktorina bot | Portfolio
1👍1🥰1
👍1🥰1😁1🤩1
#savol

#javob
#kotlin
Kotlin dasturlash tilida

fun main() {
val scanner = Scanner(System.in)
print("x = ")
val x = scanner.nextDouble()
print("e1 = ")
val e1 = scanner.nextDouble()
print("e2 = ")
val e2 = scanner.nextDouble()
print("e3 = ")
val e3 = scanner.nextDouble()
println(ExpFun(x, e1))
println(ExpFun(x, e2))
println(ExpFun(x, e3))
}

fun ExpFun(x: Double, e: Double): Double {
var k = 1.0
var p = 1.0
var a = x
var i = 2
while (a / p > e) {
k += a / p
p *= i.toDouble()
a *= x
i++
}
return k
}

Telegram | Viktorina bot | Portfolio
1👍1🥰1👏1
This media is not supported in your browser
VIEW IN TELEGRAM
Iphone 14 ning yaratilishi ... 😅

Telegram | Viktorina bot | Portfolio
👍6😁51🔥1🥰1👏1🤩1
#javob_java_boolean_39

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();
boolean farzin = (((Math.abs(x1 - x2)) == (Math.abs(y1 - y2)))
((x1 == x2) (y1 == y2)));
System.out.println(farzin);
}

Telegram | Viktorina bot | Portfolio
1👍1🔥1👏1
👍1🔥1🥰1🤩1
#savol

#javob
#java
Java dasturlash tilida

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("n = ");
int n = scanner.nextInt();
int[] a = new int[n];
int[] b = new int[n];
System.out.print(n + " ta massiv elementlarini kiriting: ");
for (int i = 0; i <= n - 1; i++) {
a[i] = scanner.nextInt();
}
int t = 0;
boolean bool;
b[0] = a[0];
for (int i = 1; i <= n - 1; i++) {
bool = true;
for (int j = 0; j <= t; j++) {
if (a[i] == b[j]) {
bool = false;
break;
}
}
if (bool) {
b[++t] = a[i];
}
}
System.arraycopy(b, 0, a, 0, t + 1);
for (int i = 0; i <= t; i++) {
System.out.print(a[i] + " ");
}
}

Telegram | Viktorina bot | Portfolio
👍3🔥1👏1😁1
#javob_java_boolean_40

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();
boolean ot = (((Math.abs(x1 - x2) == 1)) && (Math.abs(y1 - y2) == 2) ||
((Math.abs(x1 - x2) == 2)) && (Math.abs(y1 - y2) == 1));
System.out.println(ot);
}

Telegram | Viktorina bot | Portfolio
👍31🔥1🥰1👏1
#savol
2x2 matrisaning determinantini topuvchi dastur tuzing?

#javob
#determinant
#java
Java dasturlash tilida yozilgan dastur kodi

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int[][] a = new int[2][2];
System.out.print("2x2 matrisa elementlarini kiriting: ");
int d = 1, y = 1;
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 2; j++) {
a[i][j] = scanner.nextInt();
}
}
System.out.println("Siz kiritgan matrisa elementlari: ");
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 2; j++) {
System.out.print(a[i][j] + " ");
}
System.out.println();
}
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 2; j++) {
if (i == j) {
d *= (a[i][j]);
}
if (i + j == 1) {
y *= (a[i][j]);
}
}
}
System.out.println("Asosiy dioganal elementlari ko'paytmasi: " + d);
System.out.println("Yordamchi dioganal elementlari ko'paytmasi: " + y);
System.out.println("2x2 matrisaning determinanti " + (d - y));
}

Telegram | Viktorina bot | Portfolio
1👍1🔥1😁1
#savol

#javob
#kotlin
Kotlin dasturlash tilida

fun
main() {
val scanner = Scanner(System.in)
print("n = ")
val n = scanner.nextInt()
val a = IntArray(n)
val b = IntArray(n)
print("$n ta massiv elementlarini kiriting: ")
for (i in 0..n - 1) {
a[i] = scanner.nextInt()
}
var t = 0
var bool: Boolean
b[0] = a[0]
for (i in 1..n - 1) {
bool = true
for (j in 0..t) {
if (a[i] == b[j]) {
bool = false
break
}
}
if (bool) {
b[++t] = a[i]
}
}
System.arraycopy(b, 0, a, 0, t + 1)
for (i in 0..t) {
print(a[i].toString() + " ")
}
}

Telegram | Viktorina bot | Portfolio
1👍1🔥1👏1
#savol
3x3 matrisaning determinantini topuvchi dastur tuzing?

#javob
#determinant
#java
Java dasturlash tilida yozilgan dastur kodi

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int[][] a = new int[3][3];
System.out.print("3x3 matrisa elementlarini kiriting: ");
int d = 1, y = 1;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
a[i][j] = scanner.nextInt();
}
}
System.out.println("Siz kiritgan matrisa elementlari: ");
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
System.out.print(a[i][j] + " ");
}
System.out.println();
}
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {

d = (a[0][0] * a[1][1] * a[2][2] + a[0][1] * a[1][2] * a[2][0] +
a[0][2] * a[1][0] * a[2][1]);

y = (a[0][2] * a[1][1] * a[2][0] + a[1][0] * a[0][1] * a[2][2] +
a[0][0] * a[2][1] * a[1][2]);

}
}
System.out.println("d: " + d);
System.out.println("y: " + y);
System.out.println("3x3 matrisaning determinanti: " + (d - y));
}

Telegram | Viktorina bot | Portfolio
👍2🤩21🔥1👏1
1👍1🔥1🥰1
#javob
#gita_13
Java dasturlash tilida

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("n = ");
int n = scanner.nextInt();
int a = scanner.nextInt();
int min, index = 1;
min = a;
for (int i = 2; i <= n; i++) {
a = scanner.nextInt();
if (min > a) {
min = a;
index = i;
}
}
System.out.println(min + " " + index);
}

Telegram | Viktorina bot | Portfolio
👍2🔥1🥰1👏1
👍21🥰1🤩1
🔥1🥰1👏1
👍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 Integer bo'limiga yangi savollarni va ularni javoblarini qo'shdik.

Viktorina bot

Telegram | Viktorina bot | Portfolio
1🔥1👏1
E'lon ❗️❗️❗️

PROGRAMMERS kanalimizda Qudrat Abdurahimov tomonlaridan ishlab chiqilgan elektron qurilmadagi masalalar to'plamini C++, Java, Kotlin dasturlash tillarida ishlashni boshlaganmiz. 16.09.2022 (Juma) kuni, Java dasturlash tilida Butun sonlarga oid masalalar (Boolean) bo'limini yakunladik

Ertadan 19.09.2022 (Dushanba) kunidan boshlab, Kotlin dasturlash tilida Boolean bo'limini boshlaymiz.

Misollar tartibi quyidagicha.
Har kuni kanalga ertalab 8:00 va 10:00 da ikkita savol va 18:00 va 20:00 da savollarning javoblarini joylab boramiz

Telegram | Viktorina bot | Portfolio
1🔥1👏1😍1