Day 5 : Loops
Solution In Java 8:
import java.io.*;import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int i = 1;
while(i<=10)
{
System.out.println(n+" x "+i+" = "+n*i);
i++;
}
}
}
Solution In Python 3:
#!/bin/python3
import sys
n = int(input().strip())
if n>=2 and n<=20:
for i in range(1,11):
print("%d x %d = %d"%(n ,i,(n*i)))
Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging
ReplyDeleteBest Dot Net Training Institute In Chennai | Dot Net Training And Placement In Chennai | Best Dot Net Training In Chennai
Best Software Testing Training Institute In Chennai With Placement | Software Testing Training Institute In Chennai
Java Training Institute in Chennai | Core Java Training in Chennai | Java Certification in Chennai
PHP Course in Chennai | PHP Training Institute in Chennai | PHP Course and Certification