This program is used to find an odd numbers in between 15-27.Here we are using For loop and if condition.For loop is used to iterating the values and if condition is used to checking the conditions.
public class ExampleFindOdd{ public static void main(String args[]){ for(int i=15; i <= 27; i++){ if( i % 2 == 1){ System.out.print(i + " "); } } }
15,17,19,21,23,25,27
Comments :