We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Tutorials
- 30 Days of Code
- Day 5: Loops
- Discussions
Day 5: Loops
Day 5: Loops
+ 0 comments JS:
function main() { const n = parseInt(readLine().trim(), 10); for (let i = 1; i <= 10; i++) { console.log(`${n} x ${i} = ${n * i}`) } }
+ 0 comments import java.text.; import java.util.; import java.util.concurrent.; import java.util.function.; import java.util.regex.; import java.util.stream.; import static java.util.stream.Collectors.joining; import static java.util.stream.Collectors.toList;
public class Solution { public static void main(String[] args) throws IOException { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(bufferedReader.readLine().trim()); for(int i=1;i<=10;i++) { System.out.println(n+" x "+i+" = "+n*i); } bufferedReader.close(); }
}
+ 0 comments for i in range(1, 11): print('{} x {} = {}'.format(n, i, n*i))
+ 0 comments I like lambdas more :)
n = int(input()) print(*map(lambda x:f'{n} x {x} = {x*n}',range(1,11)),sep='\n')
+ 0 comments python 3
for i in range(1,11) print(n ,"x", i , "=" , (n * i))
Load more conversations
Sort 1140 Discussions, By:
Please Login in order to post a comment