C++ Online Compiler
Example: C++ Program to Print Multiplication Table using For loop
C
C++
C#
Java
Python
PHP
main.cpp
STDIN
Run
// C++ Program to Print Multiplication Table using For loop #include <iostream> using namespace std; int main() { int x, r, i; // x - To store the input number // r - To store the multiplication range cout << "----Enter the input number is::---\n"; cin >> x; cout << "\n----Enter the range number is::----\n"; cin >> r; cout << "\n\n------The above multiplication table--------\n\n"; for (i = 1; i <= r; i++) { cout << x << " * " << i << " = " << x * i << "\n"; } return 0; }
21 13
Output
Clear
ADVERTISEMENTS