22 Sen 2023, 10:46
Java programming for beginners
Kanalga Telegram’da o‘tish
Learn java programming through quizzes and videos
Ko'proq ko'rsatishMamlakat belgilanmaganToif belgilanmagan
2 941
Obunachilar
Ma'lumot yo'q24 soatlar
Ma'lumot yo'q7 kun
Ma'lumot yo'q30 kun
Postlar arxiv
import java.util.Scanner;
public class NameEvaluation {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter a number from 1 to 9: ");
int number = scanner.nextInt();
if (number >= 1 && number <= 9) {
if (number % 2 == 0) {
System.out.print("Enter your name: ");
scanner.nextLine(); // Consume the newline character left by nextInt()
String name = scanner.nextLine();
System.out.println(name + " is good");
} else {
System.out.print("Enter your surname: ");
scanner.nextLine(); // Consume the newline character left by nextInt()
String surname = scanner.nextLine();
System.out.println("Name is worst");
}
} else {
System.out.println("Invalid input. Please enter a number between 1 and 9.");
}
scanner.close();
}
}
17 Avg 2023, 01:14
Ni to eclipse me class bana ke copy paste krne eclipse khud execute kr dega
02 Iyun 2023, 11:08
Guys do vote, it will really help to see how many of you are able to write and if facing any issues discuss in group
02 Yan 2022, 09:05
arun Reddy welcome to the group. To learn how to crack coding exams
11 Mar 2022, 05:06
Ssekagya Ronald welcome to the group. To learn how to crack coding exams
22 Avg 2023, 02:09

