C++ Program to Print Multiplication Table of any Number1 min read

In this tutorial, we will write a C++ program to generate a multiplication table for any number and also for the given range.

In order to understand the program, you should go through the following topic in C++.


C++ Program to Print Multiplication Table of any Given Number

The program will print the table of the number entered by the user up to 10. The program uses for loop to iterate and print the number.

Output:

Enter the number: 4
4 * 1 = 4
4 * 2 = 8
4 * 3 = 12
4 * 4 = 16
4 * 5 = 20
4 * 6 = 24
4 * 7 = 28
4 * 8 = 32
4 * 9 = 36
4 * 10 = 40


C++ Program to Print Multiplication Table of any Number upto a given range

This program will work as same as the above, the extra feature added here is the range. The above program displays the table of any number up to 10 but here it will print the table up to the user’s choice.

The program takes user input for the number whose table needs to be displayed and also the range up to which number it should display.

Output:

Enter the number: 6
Enter range: 15
6 * 1 = 6
6 * 2 = 12
6 * 3 = 18
6 * 4 = 24
6 * 5 = 30
6 * 6 = 36
6 * 7 = 42
6 * 8 = 48
6 * 9 = 54
6 * 10 = 60
6 * 11 = 66
6 * 12 = 72
6 * 13 = 78
6 * 14 = 84
6 * 15 = 90


MORE

C Program to search an element in an array using Pointers

A separate function( search_function()) will be created where the array pointer will be declared and the searched element along with the size of an array …

C Program to find the sum of the digits of a number using recursion function

This C program calculates the sum of digits of a given number using recursion. Here’s a concise explanation: Function Definition: sumDigits(int n) This function calculates …

C program to find factorial of a numberĀ using Ternary operator with Recursion

Recursion refers to the function calling itself directly or in a cycle. Before we begin, you should have the knowledge of following in C Programming: …

C Program to Add Two Numbers Using Call by Reference

The program takes the two numbers from the user and passes the reference to the function where the sum is calculated. You may go through …

Find the output ab, cd, ef, g for the input a,b,c,d,e,f,g in Javascript and Python

In this tutorial, we will write a program to find a pairs of elements from an array such that for the input [a,b,c,d,e,f,g] we will …

String Pattern Programs in C

In this tutorial, we will write various C pattern programs for String. Before that, you may go through the following topics in C. for loop …