Exercise 1: Multiplication table
In this exercise, you have to print the multiplication table of a number up to 10
We'll cover the following
Problem Statement
Write a code which will
- Print the multiplication table of a
number
up to 10. - You have to use
do-while
loop for solving this problem. - Your code should return the string
ans
with all the values computed from multiplication appended in that string.- Here’s a link showing how you can add values to a string.
Example
Input: int num
= 5
Here’s an illustration showing what the string ans
should have stored in it at the end of the do-while
loop for the above mentioned input.
Get hands-on with 1400+ tech skills courses.