i plan to display all of the odd number, and sum all of the odd number.
please check with my code, there is something wrong...:)
import java.util.Scanner;
public class testing {
public static void main(String[] args) {
int sum = 0;
Scanner scan = new Scanner(System.in);
System.out.printf("Enter minimum number: ");
int min_Num = scan.nextInt();
System.out.printf("Enter maximum number: ");
int max_Num = scan.nextInt();
if(min_Num / 2 != 0)
for(min_Num <= max_Num)
{
System.out.println(min_Num + ", ");
sum += min_Num;
min_Num += 2;
}
}
}