Create a program that will read some numbers from the Terminal Window(console) and display only the odd numbers

import java.util.Scanner;
public class UsingScanner
{
    public static void main(String args[])
	{
	    System.out.printIn("Enter few numbers");
		Scanner os=new Scanner(System.in);
		int num=0;
		while(os.hasNextInt())
		{
		    num=os.nextInt();
		    if(num%2!=0)
		    {
		      System.out.printIn(num);
			}
		}
	}
}
		
Show Buttons
Hide Buttons