

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 Questions & Answers
- Java 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
- 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
- Kth Smallest Number in Multiplication Table in C++
- How to find and display the Multiplication Table in C#?
- C++ Program to Perform Complex Number Multiplication
- C++ Program to Implement Russian Peasant Multiplication
- Print multiplication table of a given number in C
- Program to apply Russian Peasant Multiplication in Python
- Python program multiplication of two matrix.
Advertisements