Write a program that prints a pattern of asterisks?

This is a discussion on Write a program that prints a pattern of asterisks? within the C Programming forums, part of the General Programming Boards category; Refer to the attached file to see the printout of patterns. Write a C program that prints the following patterns ...

  1. #1
    Registered User
    Join Date
    Jun 2002
    Posts
    8

    Angry Write a program that prints a pattern of asterisks?

    Refer to the attached file to see the printout of patterns.

    Write a C program that prints the following patterns separately one below the other. Use for loops to generate the patterns. All patterns should be printed by a single printf statement of the form printf("*"); (this causes the asterisks to print side by side). Hint: The last two patterns require that each line begin with an appropriate number of blanks.

    Please help! I am having much difficulty figuring this out.
    Anyones help would be greatly appreciated.

    Thank you!

    Basia
    brentall@nycap.rr.com
    Attached Files Attached Files

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Have you actually tried writing some code? If so, and you'd like some advice on it, post it here.

    If you want a tip.... read the assignment again. It's pretty obvious what you have to do, you're even told roughly how to do it.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Registered User red_baron's Avatar
    Join Date
    May 2002
    Posts
    274
    try something like this first:

    Code:
    for(numline=0;numline<=10;numline++)
    {
       for(numstar=0;numstar<=numline;numstar++)
      {
          etc.
       }
    }
    ¿Red Baron?

    "Imagination is more important than knowledge"
    -Albert Einstein (1879-1955)

    Check out my games!

    [code] /* dont forget code tags! */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Program to write to memory map addresses
    By modest in forum C Programming
    Replies: 15
    Last Post: 06-03-2008, 04:20 PM
  2. Replies: 12
    Last Post: 02-28-2008, 06:19 PM
  3. program to make a floppy write protected
    By shrijeetp in forum C Programming
    Replies: 1
    Last Post: 10-03-2005, 07:00 AM
  4. Is there another way to write this program?
    By agentxx04 in forum C Programming
    Replies: 1
    Last Post: 11-23-2004, 09:28 PM
  5. Help! Need to write a 'notepad' program..
    By Budgiekarl in forum C Programming
    Replies: 3
    Last Post: 08-01-2003, 10:20 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21