Share all news to all guy ;)

Monday, December 22, 2014



       Write a program that will ask the user to input n positive numbers. The program will terminate if one of those number is not positive.



Code here : 

public static void main(String[] args) {
       int Pos;
       Scanner In = new Scanner(System.in);
       do
       {
           System.out.print("Enter Positive Number: ");
           Pos = In.nextInt();
           
       }while(Pos>=0);
    }
    

}



0 comments:

Post a Comment

Popular Posts

Powered by Blogger.