How to multiply the multiples of a number?

Write your question here.

closed account (E3h7X9L8)
hope i helped you

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>
using namespace std;
int n,x,s1,s2,m1,m2;
int main()
{cout<<"enter number to multiple(n) ";cin >>n;
cout<<"enter how many times to multiple ";cin>>x;
cout<<endl;
cout<<"n="<<n<<endl;

s1=n;
m1=n;

do
    {
m1=m1+s1; //does multiple of n
s2=m1;
m2=m1+s2; //does multiple of n's multiple
cout<<m1<<" <-- n multiple  "<<m2<<" <-- multiple of n's multiple"<<endl;
}
while(m1<x);
}
Topic archived. No new replies allowed.