help on a c++ code?

how can i turn the number like 5 in to 5 asterisks like *****
but the user hast to enter the number it
1
2
3
4
5
6
7
8
9
  int main(int argc, char** argv) {
int num;
cout<<"enter one number"<<endl;
cin>>num;
    
    return 0;
}

you can use a for loop to cout the number of asterisks that you want.
something like this:
1
2
3
for (int i = 0; i < num; i++) {
     cout << '*';
}
Topic archived. No new replies allowed.