Thread: printing ***

  1. #1
    Bond sunnypalsingh's Avatar
    Join Date
    Oct 2005
    Posts
    162

    printing ***

    i would like to print this


    *******
    *** ***
    ** **
    * *
    *

    i am only asking for logic...

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Code:
    printf("*******\n*** ***\n** **\n* *\n*\n");
    Ask a silly question...


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Bond sunnypalsingh's Avatar
    Join Date
    Oct 2005
    Posts
    162
    Quote Originally Posted by quzah
    Code:
    printf("*******\n*** ***\n** **\n* *\n*\n");
    Ask a silly question...
    Quzah.
    My problem was not properly indented....was not able to do it....i wanted to print diamond shape....but the type of reply wasn't expecting from u.....i wanted to code it.....anyways thanx..problem was solved....

  4. #4
    Registered User
    Join Date
    Nov 2004
    Location
    USA
    Posts
    516
    look up loops like for or while...
    print required number of *s in every iteration.
    Code:
    >+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++.

  5. #5
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by sunnypalsingh
    i wanted to print diamond shape....but the type of reply wasn't expecting from u.....i wanted to code it.....anyways thanx..problem was solved....
    Right, so where exactly in your post do you say anything about printing a diamond? Oh, that's right! You didn't say anything anywhere about it. See how silly it was for you to post what you did, considering there's a PREVIEW button and an EDIT button?


    Quzah.
    Hope is the first step on the road to disappointment.

  6. #6
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    With the number of *'s printed per line in the original post, I don't see how it's possible to get a diamond shape even if the indentation is wrong. One would imagine that the top and bottom line of *'s would have the same number of *'s in it for it to print a diamond shape.
    If you understand what you're doing, you're not learning anything.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C# Printing Problem
    By silverlight001 in forum C# Programming
    Replies: 0
    Last Post: 03-23-2009, 01:13 AM
  2. Printing Lines to .txt File
    By Programmer3922 in forum C Programming
    Replies: 2
    Last Post: 08-02-2008, 12:45 PM
  3. generic printing preferences dialog box
    By stanlvw in forum Windows Programming
    Replies: 8
    Last Post: 06-27-2008, 02:20 AM
  4. printing data to a file
    By coralreef in forum C Programming
    Replies: 3
    Last Post: 11-02-2006, 08:10 PM
  5. need help relating printing?
    By omarlodhi in forum Linux Programming
    Replies: 0
    Last Post: 03-03-2006, 04:46 AM