this is the code that I wrote for printing the pattern using single however it doesn't work can you help me out.
    #include<iostream>
    using namespace std;
    int main()
    {
        int line, star = 0, n;
        cin >> n;
        for (line = 1; line <= n; line++)
        {
            if (star < n)
            {
                cout << "*";
                star++;
                continue;
            }
            if (star == line)
            {
                cout << endl;
                star 
            }
        }
        
        system("pause");
        return 0;
    }
 
     
     
     
    