Write C++ program to print multiplication table of a given number


techstudy.org

HP 15 Core i3 7th gen Laptop(4GB, 1TB HDD, Windows 10) | Rs. 31,490

Introduction

I have used CodeBlocks compiler for debugging purpose. But you can use any C++ programming language compiler as per your availability.


  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int num=0, i;
  7. //Reading number
  8.  
  9. cout<<"Enter number to print table: "<<endl;
  10. cin>>num;
  11. for(i=1; i<=10; i++)
  12. {
  13. //Printing table of number entered by user
  14. cout<<num<<" x "<<i << " = "<<num*i<<endl;
  15. }
  16. return 0;
  17.  
  18. }

Result

C++ language techstudy.org

     





Related Topics




Popular Posts