Thread: Printing Patterns

  1. #1
    Registered User
    Join Date
    Mar 2016
    Posts
    7

    Printing Patterns

    So we were asked to make a program converting Hex values into decimals then printing a pattern for the result Eg.
    input: 0x12
    desired Output:
    * *****
    * *
    * *****
    * * *
    * *****
    my output:
    *
    *
    *
    *
    *
    *****
    *
    *****
    * *
    *****


    How do I place them horizontally?
    P.S. I made a switch case and manually typed the patterns in printf. Please be easy on me, I'm just a beginner.
    Thanks in advance

  2. #2
    Registered User
    Join Date
    Jun 2015
    Posts
    1,640
    I would like to help but your question is incomprehensible.

    What does "converting hex values into decimals" mean? 0x12 in decimal is 18. I don't see any conversion.

    What does "printing a pattern for the result" mean? What kind of pattern? You seem to have printed a bunch of random asterisks.

  3. #3
    Registered User
    Join Date
    Mar 2016
    Posts
    7
    It's ok now thanks P.S. yeah that should've been 18
    Last edited by Rheegeaux; 04-04-2016 at 02:35 PM.

  4. #4
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    It appears the OP wants to print the number symbols using asterisks; e.g. 18 would be:

    Code:
    * *****
    * *   *
    * *****
    * *   *
    * *****
    @OP: Notice how code tags helps preserve spacing when illustrating such ideas.

  5. #5
    Registered User
    Join Date
    Jun 2015
    Posts
    1,640
    Quote Originally Posted by Matticus View Post
    It appears the OP wants to print the number symbols using asterisks.
    First the kitty, now this! You're good at seeing patterns. That makes sense of the question about placing them "horizontally".

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Printing number patterns - need help
    By haim1404 in forum C Programming
    Replies: 19
    Last Post: 11-17-2013, 07:46 AM
  2. Patterns and anti-patterns
    By Neo1 in forum C++ Programming
    Replies: 3
    Last Post: 10-23-2013, 05:30 PM
  3. Printing Patterns Using Recursion
    By CProgramming11 in forum C Programming
    Replies: 2
    Last Post: 11-21-2010, 03:55 PM
  4. NEED homework help! Printing out patterns.
    By omGeeK in forum C Programming
    Replies: 8
    Last Post: 09-28-2010, 07:16 PM
  5. Printing Patterns
    By ferniture in forum C Programming
    Replies: 11
    Last Post: 11-17-2008, 10:00 PM

Tags for this Thread