how to print multiplication table in c++ using for loop.

How to print table in C++
Print table in c++


Hello all, I welcome you all in this amazing article . Today we at eStudyan will make you understand how to write a code which can print the Multiplication Table of any number in C++. But first let us take a brief introduction of C++. 

C++ is a programming language created by Bjarne Stroustrup in 1985. It is an object oriented programming language which is created as an extension programming language of C.  Basically programming languages are just another kind of languages which we used to communicate with computers. Let us understand this in some detail. Take an example, you are sick and want water to drink, what will you ask someone is to provide you a glass of water. But without language you will not be able to tell someone to do this work for you. Just like that if you want computer to perform a certain kind of  task, you have to tell computer through a language which it can understand. C++ is one of them.

Now let's come to our main topic. Multiplication Table can be printed very easily in C++ and any other programming languages. It is the basic example of Applications of loops in C++. If you want to print same you can use this code:-

              #include <iostream>

         using namespace std;

         int main(){

                          int a;

                          int i;

         cout<<"ENTER A NUMBER:- ";

         cin>>a;

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

        cout<<a<<"X"<<i<<"="<<a*i<<endl;

    }    

       return 0;

}

You can check the output of this program by scrolling the iframe below and clicking RUN.   OK, so i hope you get your answer easily here.If you have some more doubts you can comment below without any hesitation. Don't forget to provide your valuable feedback in the comment section. Also you can suggest us for our upcoming posts.

THANK YOU,
TEAM eStudyan


Comments

Popular posts from this blog

[100% FIXED] How to fix internet not working without anonsurf in parrot os.

What happens to the food inside our body ?

Why is sky blue?