Thread: Help a n00b out...

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jul 2002
    Posts
    44

    Help a n00b out...

    Uh. Hi. I'm new to this board, and very new to C++. Some concepts are hard for me to understand... Right now I'm learning about loops... like, for, if, else, so and so. I have to complete a few excersices for "homework" If you will. I need to create the following using the For loop. I really need help on 2-4... I figured 1 out easily. Thanks in advance.

    1)
    *****
    ****
    ***
    **
    *
    Code:
    //code I used for above
    #include<stdio.h>
    #include<conio.h>
    
    void main()
    {
    
    int i, j;
    for(i=5; i>=1; i--)
    
    {
    
            for(j=1; j<=i; j++)
            {
            printf(" * ",j);
    
            }
            printf("\n");
    
    
    }
    
    getch();
    
    }
    //Really simple...
    Now the following is what I need help with.

    2)
    ****
    --***
    ---**
    ----*

    3)
    -*
    -***
    ****

    4)
    1
    101
    1010
    10101


    Of course, I don't want you to do any of the work for me... but maybe an example or two with a different scenario, or just maybe some tips will help me on my way. I don't know much in C, so please try to stick to the most basic functions, like printf, scanf, and loops, like if, else and for. I know I could just do printf and get the same output... but that's not the point of the exercise. Again, Thanks in Advance! Oh, and teh dashes, they stand for SPACE...

    -ddy02
    Last edited by diddy02; 07-15-2002 at 09:00 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. n00b questions
    By C+noob in forum C++ Programming
    Replies: 43
    Last Post: 07-09-2005, 03:38 PM
  2. n00b problems
    By piebob in forum C++ Programming
    Replies: 2
    Last Post: 06-17-2005, 01:51 AM
  3. n00b Code Error.
    By Zeusbwr in forum C++ Programming
    Replies: 4
    Last Post: 10-11-2004, 05:15 PM
  4. n00b doing a Socket operation on non-socket
    By Kinasz in forum Networking/Device Communication
    Replies: 2
    Last Post: 03-25-2004, 03:29 AM
  5. ISO someone daring to look at some n00b code!
    By Rev. Jack Ed in forum Game Programming
    Replies: 4
    Last Post: 10-17-2003, 08:45 AM