You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* Εκφώνηση: Να γραφεί πρόγραμμα που θα ελέγχει το πρόσημο ενός αριθμού που δίνει ο χρήστης. Θα εισάγονται συνεχόμενες τιμές και θα δίνεται το πρόσημό τοιυς μέχρι ο χρήστης να δώσει τον αριθμό 0, οπου και το πρόγραμμα θα κλείνει. */
package MyFirstPackage;
import java.util.Scanner;
public class ElegxosThetikouArithmou {
public static void main(String[] args) {
// TODO Auto-generated method stub
int x;
Scanner sc = new Scanner(System.in);
do {
System.out.println("vale timh gia elegxo, axrhste");
x = sc.nextInt();
if ( x > 0) {
System.out.println("o arithmos " + x + " einai thetikos" );
}
else if (x == 0) {
System.out.println("o arithmos den exei prosimo");