C++ : display multiples of any entered number


#include<iostream>
#include<conio.h>

using namespace std;

int main()
{
int n,i,j,m=0;
cout<<"Enter any number to display it's multiple : ";
cin>>n;
cout<<"\nThe multiple of "<<n<<" is given below\n\n";
for(i=1,j=1;i<=20;i++,j++)
{
m=m+n;
cout<<m<<"\t";
if(j==10)
{
cout<<"\n";
j=0;
}

}
getch();
return(0);

}

No comments:

Post a Comment