Hi,Today we learn how to make your desired table using while loop in c++ we try to make Program to Find the Multiplication Table Of a Given number.If User Enter Any Number Show Table and Also Value up to which user want in table.
Multiplication Table Of a Given Number Using while Loop in C++
#include<iostream> #include<conio.h> using namespace std; main() { int x,y,z; y=1; cout<<"Enter the value for which you want the table:"; cin>>x; cout<<"Enter the value up to which you want the table:"; cin>>z; while(y<=z) { cout<<x<<"*"<<y<<"="<<y*x<<endl; y=y+1; } getch(); }
Output of Program
Enter any num: 2 Table 2 4 6 8 10 12 14 16 18 20