Answer to Question #303784 in Java | JSP | JSF for Bosslebran

Question #303784

Enter an integer: 20





20 plus 10 is 30.





20 plus 100 is 120.





20 plus 1000 is 1020.






1
Expert's answer
2022-02-28T13:53:33-0500
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        System.out.println("Enter an integer:");
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        for (int i = 10; i < 10000; i *= 10) {
            System.out.println(n + " plus " + i + " is " + (n + 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
APPROVED BY CLIENTS