Home TechnologyProgramming Subscribe to RSS

Can You Write A Program That Will Output The Following Pattern?

1 22 333

Answer Question

1 Answer - Sort by: Date | Rating

    #include


    void main()
    {
    // Define integers

    int x;
    // Input the required number like 5, 6, or any other
    cin>>x;

    //For loop for the number to be printed
    for(int tc=1;tc<=x;tc++)

    {
    // For loop for how many times the number to be printed.

    for(int b=1;b<=tc;b++)

    // Show or print the number

    count<<,tc // Don't put comma before tc. I put it because of HTML reasons
    cout<<"n";

    }

                    }

    Enjoy blurting :)
    0 0

    Ellie82  

    answered 1 year ago

      More

         
         

        Ask a Question via Twitter

        Send a question to @askblurtit and we will publish it online and send you a reply everytime you receive an answer.

        Blurtit Store

        Get T-shirts, hoodies, caps and more at the Blurtit store

        Blurtit International