dont know where to start!! help

This is a discussion on dont know where to start!! help within the C Programming forums, part of the General Programming Boards category; Hi!!! I have received the question paper from my prof. and there was just one question i was not able ...

  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,796
    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, 02: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, 02:21 PM
  5. Start bar color in WinXP
    By confuted in forum Tech Board
    Replies: 4
    Last Post: 05-03-2003, 07:18 AM

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