#savol
for operatoridan foydalangan holda quyidagi ko'rinishni (fibonachchi) chiqaruvchi dastur tuzing?
Java dasturlash tilida
#javob
#java
public static void main(String[] args) {
int k;
for (int i = 5; i >= 1; i--) {
k = i;
for (int j = 1; j <= i; j++) {
System.out.print(k + " ");
k = k + (5 - j);
}
System.out.println();
}
}
Chiquvchi ma'lumot 👇👇👇
5 9 12 14 15
4 8 11 13
3 7 10
2 6
1
Telegram | Viktorina bot | YouTube
for operatoridan foydalangan holda quyidagi ko'rinishni (fibonachchi) chiqaruvchi dastur tuzing?
Java dasturlash tilida
#javob
#java
public static void main(String[] args) {
int k;
for (int i = 5; i >= 1; i--) {
k = i;
for (int j = 1; j <= i; j++) {
System.out.print(k + " ");
k = k + (5 - j);
}
System.out.println();
}
}
Chiquvchi ma'lumot 👇👇👇
5 9 12 14 15
4 8 11 13
3 7 10
2 6
1
Telegram | Viktorina bot | YouTube
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
👍3🔥1
#javob_cpp_boolean_25
#include <iostream>
using namespace std;
int main(){
bool boolean;
int x, y;
cout << "x = ";
cin >> x;
cout << "y = ";
cin >> y;
boolean = (x < 0 && y > 0);
cout << boolean;
}
Telegram | Viktorina bot | YouTube
#include <iostream>
using namespace std;
int main(){
bool boolean;
int x, y;
cout << "x = ";
cin >> x;
cout << "y = ";
cin >> y;
boolean = (x < 0 && y > 0);
cout << boolean;
}
Telegram | Viktorina bot | YouTube
👍7❤1👏1
#savol
#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[] a = new int[n];
for (int i = 0; i < n; i++) {
a[i] = scanner.nextInt();
}
System.out.print("siz kiritgan massiv elementlari: ");
for (int i = 0; i < n; i++) {
System.out.print(a[i] + " ");
}
System.out.println();
int k = 0;
n--;
while (k <= n) {
System.out.print(a[k++] + " ");
if (k - 1 >= n) break;
System.out.print(a[k++] + " ");
if (k - 1 >= n) break;
System.out.print(a[n--] + " ");
if (k - 1 >= n) break;
System.out.print(a[n--] + " ");
}
}
Telegram | Viktorina bot | YouTube
#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[] a = new int[n];
for (int i = 0; i < n; i++) {
a[i] = scanner.nextInt();
}
System.out.print("siz kiritgan massiv elementlari: ");
for (int i = 0; i < n; i++) {
System.out.print(a[i] + " ");
}
System.out.println();
int k = 0;
n--;
while (k <= n) {
System.out.print(a[k++] + " ");
if (k - 1 >= n) break;
System.out.print(a[k++] + " ");
if (k - 1 >= n) break;
System.out.print(a[n--] + " ");
if (k - 1 >= n) break;
System.out.print(a[n--] + " ");
}
}
Telegram | Viktorina bot | YouTube
👍2❤1🔥1
Java.exe
7 MB
👍1🔥1
#javob_cpp_boolean_26
#include <iostream>
using namespace std;
int main(){
bool boolean;
int x, y;
cout << "x = ";
cin >> x;
cout << "y = ";
cin >> y;
boolean = (x > 0 && y < 0);
cout << boolean;
}
Telegram | Viktorina bot | YouTube
#include <iostream>
using namespace std;
int main(){
bool boolean;
int x, y;
cout << "x = ";
cin >> x;
cout << "y = ";
cin >> y;
boolean = (x > 0 && y < 0);
cout << boolean;
}
Telegram | Viktorina bot | YouTube
❤2👍1
#javob_cpp_boolean_27
#include <iostream>
using namespace std;
int main(){
bool boolean;
int x, y;
cout << "x = ";
cin >> x;
cout << "y = ";
cin >> y;
boolean = ((x < 0 && y > 0) || (x < 0 && y< 0));
cout << boolean;
}
Telegram | Viktorina bot | YouTube
#include <iostream>
using namespace std;
int main(){
bool boolean;
int x, y;
cout << "x = ";
cin >> x;
cout << "y = ";
cin >> y;
boolean = ((x < 0 && y > 0) || (x < 0 && y< 0));
cout << boolean;
}
Telegram | Viktorina bot | YouTube
❤1👍1🔥1
Media is too big
VIEW IN TELEGRAM
Java - Kiritilgan sonning raqamlari yig'indisini aniqlovchi dastur
Telegram | Viktorina bot | Portfolio
Telegram | Viktorina bot | Portfolio
👍2🔥1
#javob_cpp_boolean_28
#include <iostream>
using namespace std;
int main(){
bool boolean;
int x, y;
cout << "x = ";
cin >> x;
cout << "y = ";
cin >> y;
boolean = ((x > 0 && y > 0) || (x < 0 && y < 0));
cout << boolean;
}
Telegram | Viktorina bot | Portfolio
#include <iostream>
using namespace std;
int main(){
bool boolean;
int x, y;
cout << "x = ";
cin >> x;
cout << "y = ";
cin >> y;
boolean = ((x > 0 && y > 0) || (x < 0 && y < 0));
cout << boolean;
}
Telegram | Viktorina bot | Portfolio
❤3👏2🔥1