I have a my code that's look like this
#include <iostream>
#include <string>
using namespace std;
int main()
{
int x;
char chars = '*';
cin >> x;
for (int i=1; i<=x; i++){
cout << chars * i << endl;
}
cout << "\n\n";
system("pause");
return 0;
}
and it compiled succesfully but, when I run it i just display this
1
42
and I want to print ('*') in x times, please someone help me