Pages

Friday, March 28, 2025

code to print multiplication table of a number entered by an user in C++

#include <iostream>
#include <cmath>

// code to print multiplication table of a number entered by an user.
using namespace std;

int main(){
    int num;

    cout << "enter a num : ";
    cin >> num;

    for(int i = 1; i <= 10; i++){

        int multiply = num*i;

        cout << num << " " << "x " << i << " is " << multiply << endl;
    }
    return 0;

}

No comments:

Post a Comment

Stack using Linked List – Partial (University Exam Topic)

 #include <iostream> using namespace std; struct Node {     int data;     Node* next; }; class Stack {     Node* top; public:     Stac...