public class oddnum {
public static void main(String[] args) {
int O=odd(100);
System.out.println(O);
}
public static int odd(int num){
for(int i=2; i<=num; i++){
if(i%2==0){
return i;
}
}
}
}
Instructor
Ashish Thakur Replied on 12/06/2019
You need to return an integer outside the for loop as well.