Day 5: Loops
Day 5: Loops
CPP Code
#include <iostream>
using namespace std;
int main() {
int N;
cin >> N;
for (int i = 1; i < 11; i++) {
printf("%i x %i = %i\n", N, i, N * i);
}
return 0;
}
Python Code
import sys
N = int(input().strip())
for i in range(1, 11):
print(str(N) +" x " + str(i) + " = " + str(N*i))