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

Question #285989

while loop


sample output


a. 20 5 16 4 12 3 8 2 4 1



1
Expert's answer
2022-01-09T13:06:22-0500
// use it to enter the number from keyboard
//import java.util.Scanner;

public class Main
{
    public static void main (String[] args)
    {
        // use it to enter the number from keyboard
        //Scanner in = new Scanner(System.in);
        //int num = in.nextInt();
        int num = 5;
        while (num > 0) {
            System.out.print(num * 4 + " " + num + " ");
            num--;
        }
    }
}

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