Follow This Blog For more... 😊

Floyd`s Triangle Patterns using C++.

Floyd`s Triangle Patterns using C++.

CODE:

    //Floyd`s Triangle

    #include<iostream>
    using namespace std;

    main()
    {
        int c=1,i,j,n;
       
        cout<<"Enter Number of Rows:";cin>>n;
       
        for(i=1;i<=n;i++)
        {
            for(j=1;j<=i;j++)
            {
                cout<<c;
                if(c<10)
                {
                    cout<<"  ";
                }
                else
                {
                    cout<<" ";
                }
                c++;
            }
            cout<<endl;
        }
    }

OUPUT:



Comments

Popular Posts