Problem in finding what's wrong with my code

This is my code for this question—
#include
using namespace std;
int main() {
int n;
cin >> n;
int k = 1;
while(k <= n){
for(int i = 1; i<=k; i++){
cout << i;
}
for(int star = n; star < k; star–){
cout << “*”;
}
cout << endl;
k++;
}
return 0;
}
Can you please tell me what’s wrong with this code?

This is the link to my code — https://ide.codingblocks.com/s/322912

hi @chaturvedia336,
You were just doing one small mistake in printing the stars,I have corrected it.
Instead of star < k,it should be star > k


Please let me know if there is any other doubt.