Answer to Question #285543 in Java | JSP | JSF for kkkkkk

Question #285543

for loop sample output a. 19 17 15 13 11 9 7 5 3 1


1
Expert's answer
2022-01-07T09:00:51-0500
// 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 + " ");
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog