Jump to content

my do while


alman542004

Recommended Posts

dont know where to put my dowhile at and its not working

 

import java.util.*;

public class 

{

 

    public static void main(String[] args)

    {  do{   

      int number;

      String again;

      Scanner keyboard = new Scanner (System.in);

      System.out.print("Enter one number to be calulated as odd or even --:> ");//prompting the user

      number = keyboard.nextInt();

      evenLine(number);

      System.out.print("do u want ro run again");

      again = keyboard.next().toUpperCase();

          }while(again.equalsIgnoreCase("Y"));

    }

    public static void evenLine(int number)

    {   

     

            if(number% 2 == 0)

            {

                System.out.println(number+" is even number");

            }

            else

            {

                System.out.println( number+" is odd number");

            }

             

                     

       

    }

 

 

Link to comment
https://forums.phpfreaks.com/topic/242518-my-do-while/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.