answersLogoWhite

0


Best Answer

import java.io.*;

class aeven

{

public static void main(String[] args)

{

try{

BufferedReader br1 = new BufferedReader(new InputStreamReader(System.in));

System.out.println("Enter 1st number : ");

int num1 = Integer.parseInt(br1.readLine());

System.out.println("Enter 2nd number : ");

int num2 = Integer.parseInt(br1.readLine());

System.out.println("Odd Numbers : ");

for (int i=num1;i <=num2 ; i++)

{

if(i%2!=0 )

{

System.out.print(i+ ", ");

}

}

}

catch(Exception e){}

}

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you find odd numbers between two numbers in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp