problem 1: print the table of N.

 

Multiplication Table
School

Print the multiplication table of a given number N. 


Example 1:

Input:
N = 9

Output:
9 18 27 36 45 54 63 72 81 90
 
 
ANSWER:
 
vector<int> getTable(int N)
{
vector<int> vec;
for(int i=1;i<11;i++)
{
vec.push_back(N*i);
}
return vec;
}

Comments

Popular posts from this blog

problem 3: given two integers N and M. The problem is to find the number closest to N and divisible by M. If there are more than one such number, then output the one having maximum absolute value.

problem no 7:Given two numbers A and B, find Kth digit from right of AB.

Problem no 16: count the number of squares below N.