plese help me with this

welcome , I just have a Question my code to show multiplication table for just 1 number if the user wana put another number to show him also another table what I have to make or add something with this is cod

thank you so much cuz always help me .
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 main()
{

  int i;

cout<<"plese enter a number To Find multiplication table ";
cin>>i;

   for(int j=1;j<=10;j++)
   {

       cout<<i<<" * "<<j<<" = "<<i*j<<endl;

    }

system("pause");
  return 0;
}
uhm, i dont get the question. are u asking to make it so the user can ask the computer again for another table? if yes why not use a while loop?
yes , but how can I use it with this is code ??


thank you so much .
you can ask the user how many times he'd like to use the program. then use either while/for loop. i added a new variable "x", x is the number of times the user is gonna use the program. is this o.k?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 #include<iostream>
using namespace std;

int main()
{

  int i, x;

cout<<"How many times would you like to use the program?: ";
cin>>x;

for(int y = 0; y != x; y++){
cout<<"\nplese enter a number To Find multiplication table ";
cin>>i;

   for(int j=1;j<=10;j++)
   {

       cout<<i<<" * "<<j<<" = "<<i*j<<endl;

    }
}

  return 0;
}
Last edited on
oh thank u so much that what I need ,thankkkkk u again
no prob. ^^
Topic archived. No new replies allowed.