#nested for

12 messages · Page 1 of 1 (latest)

proven fogBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

vestal pier
#
#include <iostream>
#include <cmath>
using namespace std;

 int main()
{
    int n;
   char symbol;
    cout << "enter number of rows: ";
    cin >> n;
    cout << "enter a symbol: ";
    cin >> symbol;
    for ( int i = 0; i <= n; i++)
    {
    for ( int j = 0; j <= symbol; j++)
    {
        cout << symbol;
    }
   
    
      


    cout << endl;
    }
    cout << endl;
    return 0;
}
#

yo guys frist of all ik that my code is messed up

#

but i didnot know how to make this matrix like how do i put the char in a diagonal way

vestal pier
#

may someone help me ?

proven fogBOT
#

@vestal pier

Please Do Not Delete Posts!

Please don't delete forum posts. They can be helpful to refer to later and other members can learn from them. You can use !solved to close a post and mark it as solved.

vestal pier
#

!solved

proven fogBOT
buoyant vaporBOT
#
Program Output
enter number of rows: enter a symbol: