for loop sample output a. 19 17 15 13 11 9 7 5 3 1
// use it to enter the number from keyboard
//import java.util.Scanner;
public class Main
{
public static void main (String[] args) throws java.lang.Exception
{
// use it to enter the number from keyboard
//Scanner in = new Scanner(System.in);
//int num = in.nextInt();
int num = 19;
for (int i = num; i > 0; i -= 2) {
System.out.print(i + " ");
}
}
}
Comments
Leave a comment