
- C++ Basics
- C++ Home
- C++ Overview
- C++ Environment Setup
- C++ Basic Syntax
- C++ Comments
- C++ Data Types
- C++ Variable Types
- C++ Variable Scope
- C++ Constants/Literals
- C++ Modifier Types
- C++ Storage Classes
- C++ Operators
- C++ Loop Types
- C++ Decision Making
- C++ Functions
- C++ Numbers
- C++ Arrays
- C++ Strings
- C++ Pointers
- C++ References
- C++ Date & Time
- C++ Basic Input/Output
- C++ Data Structures
- C++ Object Oriented
- C++ Classes & Objects
- C++ Inheritance
- C++ Overloading
- C++ Polymorphism
- C++ Abstraction
- C++ Encapsulation
- C++ Interfaces
C++ Program to Generate Multiplication Table
The multiplication table is used to define a multiplication operation for any number. It is normally used to lay the foundation of elementary arithmetic operations with base ten numbers.
The multiplication table of any number is written till 10. In each row, the product of the number with 1 to 10 is displayed. An example of the multiplication table of 4 is as follows −
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
A program that generates the multiplication table of the given number is as follows.
Example
#include <iostream> using namespace std; int main() { int n = 7, i; cout<<"The multiplication table for "<< n <<" is as follows:"<< endl; for (i = 1; i <= 10; i++) cout << n << " * " << i << " = " << n * i << endl; return 0; }
Output
The multiplication table for 7 is as follows: 7 * 1 = 7 7 * 2 = 14 7 * 3 = 21 7 * 4 = 28 7 * 5 = 35 7 * 6 = 42 7 * 7 = 49 7 * 8 = 56 7 * 9 = 63 7 * 10 = 70
In the above program, a for loop is used from 1 to 10. In each iteration of the for loop, the number is multiplied with i and the product is displayed. This is demonstrated by the following code snippet.
for (i = 1; i <= 10; i++) cout << n << " * " << i << " = " << n * i <<endl;
- Related Articles
- Java Program to Generate Multiplication Table
- Swift Program to Generate Multiplication Table
- Haskell Program to Generate Multiplication Table
- Kotlin Program to Generate Multiplication Table
- C Program to represent a multiplication table.
- Java program to print a multiplication table for any number
- C program to print multiplication table by using for Loop
- Java Program to Print the Multiplication Table in Triangular Form
- Haskell Program to Print the Multiplication Table in Triangular Form
- C++ Program to Print the Multiplication Table in Triangular Form
- Golang Program to Print the Multiplication Table of a Given Number
- How to Display the multiplication Table using Python?
- C++ Program to Perform Matrix Multiplication
- How to find and display the Multiplication Table in C#?
- C++ Program to Implement Booth’s Multiplication Algorithm for Multiplication of 2 signed Numbers

Advertisements