Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Displaying patterns in c++

  • 05-11-2014 10:12am
    #1
    Closed Accounts Posts: 4


    I'm fairly new to c++ and programming in general. I'm trying to figure out how to display a pattern. I know I need to use nested for loops but after hours of doing my head in, I can't figure it out. The pattern is this:
    xxxxx
    xxxxx
    xxxxx
    xxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxx
    xxxxx
    xxxxx
    xxxxx

    I need to display the pattern with the spaces too. 3 rows of 5 x's, 3 rows of 15 x's then 3 rows of 5 x's.

    Any help at all?


Comments

  • Registered Users, Registered Users 2 Posts: 7,157 ✭✭✭srsly78


    Well here is how to do a newline:
    std::cout << std::endl;

    Which bit are you stuck with? Post up what you have attempted so far.

    To get started: copy paste the usual "hello world" program then start putting loops and stuff in.


Advertisement