Day 5: Loops HackerRank Solution


Day 5: Loops HackerRank Solution
Source : https://www.hackerrank.com/challenges/30-loops



Source : https://www.hackerrank.com/challenges/30-loops


Solution


// Karthikalapati.blogspot.com
import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int multiplier = scan.nextInt();
scan.close();
for (int i = 1; i <= 10; i++) {
System.out.format("%d x %d = %d%n", multiplier, i , i * multiplier);
}
}
}

No comments:

Post a Comment