22 sep 2023, 10:46
Java programming for beginners
Ir al canal en Telegram
Learn java programming through quizzes and videos
Mostrar másEl país no está especificadoLa categoría no está especificada
2 941
Suscriptores
Sin datos24 horas
Sin datos7 días
Sin datos30 días
Archivo de publicaciones
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 ago 2023, 01:14
Ni to eclipse me class bana ke copy paste krne eclipse khud execute kr dega
02 jun 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 ene 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 ago 2023, 02:09

