Thread: dont know where to start!! help

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    13

    Unhappy dont know where to start!! help

    Hi!!! I have received the question paper from my prof. and there was just one question i was not able to think it out, neither know where to start also. I was wondering if you could help me out here again. Just a short pseudocode or program will do so i can study it. Thx.

    Question no. 4) Write a program that sums a sequence of integers. Assume that the first integer read specifies the number of values remaining to be centered. Your program should read only one value each time.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    Translating problems into algorithms is an important ability to learn, for a simple problem such as this, read the paragraph and take keywords such as integer and sum out of it and assemble your algorithm. You'd end up with something similar to this:

    Read an integer, use that integer as the condition for a loop, inside the loop read more integers and add them all together, after the loop print the result.

    From there it's just a matter of turning the algorithm into C code, which is the easy part. Once you know how to do something, telling the computer how to do it is simple.

    -Prelude
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 09:35 AM
  2. Adventures in labyrinth generation.
    By guesst in forum Game Programming
    Replies: 8
    Last Post: 10-12-2008, 01:30 PM
  3. C++ gui for windows where to start
    By prixone in forum Windows Programming
    Replies: 2
    Last Post: 12-16-2006, 11:48 PM
  4. GNOME Desktop won't start (Mandriva)
    By psychopath in forum Tech Board
    Replies: 10
    Last Post: 07-19-2006, 01:21 PM
  5. Start bar color in WinXP
    By confuted in forum Tech Board
    Replies: 4
    Last Post: 05-03-2003, 06:18 AM