Site icon T4Tutorials.com

C++ program to show table of a number

<a href=”https://t4tutorials.com/shamils-memory-table/”><img class=”size-full wp-image-48543 aligncenter” src=”https://t4tutorials.com/wp-content/uploads/shamil-memory-table.webp” alt=”shamil memory table” width=”1255″ height=”715″ /></a>
C++ program to show a table of a number.

#include <iostream>
using namespace std;
int main()
{
    int n;
    cout << "Please Enter a positive integer: ";
    cin >> n;
    for (int i = 1; i <= 4; ++i) 
{
        cout << n << " * " << i << " = " << n * i << endl;
    } 
    return 0;
}

print table from 1 to 10 in C++
C++ program to show table from 1 to 10
C++ example to show table using for loop
C++ table
#include <iostream>
using namespace std;
int main()
{
    int n;
    cout << "Please Enter a positive integer: ";
    cin >> n;
    for (int i = 1; i <= 10; ++i) 
{
        cout << n << " * " << i << " = " << n * i << endl;
    } 
    return 0;
}

Exit mobile version