i have to write a program where i input two positive integers (L and H) which are both less than 21. the program then prints out a box of solid asterisks wit L horizontal asterisks and H vertical asterisks.
i dont really know where to start... can someone tell me?
need help writing this c program
Started by bbbballin, Sep 28 2009 08:10 PM
5 replies to this topic
#1
Posted 28 September 2009 - 08:10 PM
|
|
|
#2
Posted 28 September 2009 - 09:44 PM
If you mean C++ you want to start by familiarizing yourself with the IO Stream Library in particular cin and cout. If you mean C you want to start by familirarizing yourself with stdio in particular printf and scanf/sscanf/fgets.
#3
Posted 29 September 2009 - 04:15 AM
Maybe before reading those libraries, you'd better make an algorithm? You know, decide how you gonna solve the problem before starting solving it.
#4
Posted 29 September 2009 - 06:56 AM
Nested for loops.
#5
Posted 29 September 2009 - 12:27 PM
Write out pseudocode. Start with plain English, write how you would do it manually, then try to convert that into programming structures.
sudo rm -rf /
#6
Posted 30 September 2009 - 08:59 AM
An example of some pseudocode would be this:
- Declaring your variables (in this case, L and H)
- Assigning your variables to the user-inputted numbers
- Printing them to the screen
It's in plain English and describes the steps required for your program. You can break it down into smaller, simpler steps, as you wish. The simpler and smaller your steps are, the easier it will be program, because you'll have a better understanding on what needs to happen.
Hope that helps. :)
- Declaring your variables (in this case, L and H)
- Assigning your variables to the user-inputted numbers
- Printing them to the screen
It's in plain English and describes the steps required for your program. You can break it down into smaller, simpler steps, as you wish. The simpler and smaller your steps are, the easier it will be program, because you'll have a better understanding on what needs to happen.
Hope that helps. :)


Sign In
Create Account

Back to top









