1.03K subscribers
1.77K photos
420 videos
676 files
3.85K links
Download Telegram
#savol_39

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

Telegram | Viktorina bot | Youtube
#savol_40

#javob_40
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();
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 | Youtube
1
#savol_cpp_begin_11
Nolga teng bo'lmagan ikkita son berilgan. Ularning yig'indisini, ko'paytmasini va har birining modulini aniqlang.

#javob_cpp_begin_11
#include <iostream>
#include <math.h>
using namespace std;
int main(){
double a, b, a2, b2, yigindi, kopaytma;
cout <<"a = ";
cin >> a;
cout <<"b = ";
cin >> b;
yigindi = a + b;
kopaytma = a * b;
a2 = abs(a);
b2 = abs(b);
cout << "Yig'indi = " << yigindi << endl;
cout << "Ko'paytma = " << kopaytma << endl;
cout << "a ning moduli = " << a2 << endl;
cout << "b ning moduli = " << b2 << endl;
}

Telegram | Viktorina bot | Youtube
#savol
n!!=n*(n-2)*(n-4)*..…
Do while operatori yordamida dasturini tuzing?

#javob
Java dasturlash tilida

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("n = ");
int n = scanner.nextInt();
int p = 1;
do {
p *= n;
n -= 2;
} while (n > 0);
System.out.println("Natija = " + p);
}

Telegram | Viktorina bot | YouTube
This media is not supported in your browser
VIEW IN TELEGRAM
#savol_cpp_begin_12
To'g'ri burchakli uchburchakning katetlari a va b berilgan. Uning gipotenuzasi c va perimetri p aniqlang.

#javob_cpp_begin_12
#include <iostream>
#include <math.h>
using namespace std;
int main(){
double a, b, c, perimetr;
cout <<"a = ";
cin >> a;
cout <<"b = ";
cin >> b;
c = sqrt(a * a + b * b);
perimetr = a + b + c;
cout << "Gipotenuza = " << c << endl;
cout << "Perimetr = " << perimetr << endl;
}

Telegram | Viktorina bot | Youtube
#savol
OX va OY o'qlarida yotmaydigan nuqta koordinatalari berilgan. Berilgan nuqta joylashgan koordinata choragini aniqlang?

#javob
Java dasturlash tilida

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("x = ");
int x = scanner.nextInt();
System.out.print("y = ");
int y = scanner.nextInt();
if (x > 0) {
if (y > 0) {
System.out.println("I chorak");
} else {
System.out.println("IV chorak");
}
}
if (x < 0) {
if (y > 0) {
System.out.println("II chorak");
} else {
System.out.println("III chorak");
}
}
}

Telegram | Viktorina bot | YouTube
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 ...

Botga yangi savollarni (Kotlin bo'limiga) va ularning javoblarini qo'shdik.

👉 /start ni yuborib, yangi bo'limni qabul qiling.

Viktorina bot

Telegram | Viktorina bot | Youtube
#savol_cpp_begin_13
Umumiy markazda bo'lgan ikkita aylana radiusi berilgan. R1, R2 (R1>R2) Ularning yuzalari S1 va S2, ularning ayirmasini S3 aniqlang.

S1 = Pi*R1, S2 = Pi*R2, S3 = Pi*(R1-R2)

#javob_cpp_begin_13
#include <iostream>
#include <math.h>
using namespace std;
int main(){
double R1, R2, S1, S2, S3, Pi = 3.1415;
cout <<"R1 = ";
cin >> R1;
cout <<"R2 = ";
cin >> R2;
S1 = R1 * R1 * Pi;
S2 = R2 * R2 * Pi;
S3 = Pi * (R1 - R2);
cout << "Birinchi aylananing yuzasi = " << S1 << endl;
cout << "Ikkinchi aylananing yuzasi = " << S2 << endl;
cout << "Ularning ayirmasi = " << S3;
}

Telegram | Viktorina bot | Youtube
#savol_36

#javob_36
C++ dasturlash tilida

#include <iostream>
using namespace std;
int main(){
int x1, y1, x2, y2;
bool ruh;

cout << "x1 = ";
cin >> x1;
cout << "y1 = ";
cin >> y1;
cout << "x2 = ";
cin >> x2;
cout << "y2 = ";
cin >> y2;
ruh = ((x1 == x2) || (y1 == y2));

cout << ruh;

return 0;
}

Telegram | Viktorina bot | Youtube
#savol

#javob
Java dasturlash tilida

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("x = ");
double x = scanner.nextDouble();
System.out.print("y = ");
double y = scanner.nextDouble();
System.out.print("z = ");
double z = scanner.nextDouble();
double natija = Math.log10(Math.abs(x + Math.pow((z + 2), 2)))
/ Math.log10(4);
System.out.println("Natija = " + natija);
}

Telegram | Viktorina bot | Youtube
#savol_34

#javob_34
Java dasturlash tilida

public
static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("x = ");
int x = scanner.nextInt();
System.out.print("y = ");
int y = scanner.nextInt();
boolean oq = (x + y) % 2 == 1;
System.out.println(oq);
}

Telegram | Viktorina bot | Youtube