help with c program(for loop) , complete beginner..

This is a discussion on help with c program(for loop) , complete beginner.. within the C Programming forums, part of the General Programming Boards category; Write a program to produce the following output(using nested for loop) http://photos1.blogger.com/blogger/3...20output.0.jpg How to generate such patterns , I heard ...

  1. #1
    Registered User
    Join Date
    Apr 2012
    Posts
    1

    help with c program(for loop) , complete beginner..

    Write a program to produce the following output(using nested for loop)
    http://photos1.blogger.com/blogger/3...20output.0.jpg

    How to generate such patterns , I heard these type of questions are good for understanding nesting loops.
    Can someone explain step by step logic into solving such problems?

  2. #2
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    So what do you think is happening in that loop? Better yet, what have you tried so far?
    1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
    2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
    3. Get rid of conio.h and other antiquated DOS crap headers.
    4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

  3. #3
    Registered User
    Join Date
    Oct 2011
    Posts
    24
    what have you written so far? do you know what type of loop you're gonna do? First think how you would do that with the same character, then think how it is going to change. Show us the code you have so far so we can help (:

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A Complete Beginner With a Big Probelm
    By ayoonisito in forum C Programming
    Replies: 18
    Last Post: 10-25-2011, 10:40 PM
  2. Complete Beginner.
    By nubby in forum C Programming
    Replies: 14
    Last Post: 10-02-2007, 07:00 AM
  3. Help out a complete beginner
    By Jmcrofts in forum C++ Programming
    Replies: 7
    Last Post: 07-28-2007, 12:09 PM
  4. Complete Beginner [Need Help]
    By Vintik in forum C++ Programming
    Replies: 10
    Last Post: 08-15-2005, 05:08 PM
  5. Complete Beginner, HELP!!
    By britneyspy in forum C++ Programming
    Replies: 19
    Last Post: 06-12-2003, 11:01 AM

Tags for this Thread


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