Search:

Type: Posts; User: rocksteady

Search: Search took 0.01 seconds.

  1. Replies
    15
    Views
    6,880

    I meant for it to add an input value to a...

    I meant for it to add an input value to a variable initialized to 0, multiple times. Should I change the condition so that x>=0?
  2. Replies
    15
    Views
    6,880

    Here is my revised code: int sum (int x,...

    Here is my revised code:


    int sum (int x, int y)

    {
    int sum; /* sum of the two input numbers */

    for (sum=0; x<y; sum+y)
    x--;
  3. Replies
    15
    Views
    6,880

    Edited: hindsight is 20/20 :(

    Edited: hindsight is 20/20 :(
  4. Replies
    15
    Views
    6,880

    Repeated Addition

    Hello everyone,

    I'm trying to write pseudocode for a function that uses repeated addition instead of multiplication. In other words, inputting 2 and 5 should return 10, using only addition.

    So...
  5. Replies
    2
    Views
    1,837

    Testing the feasibility of algorithms

    Problem Statement
    I'm working with a problem that asks to test the feasibility an optimal order algorithm. The problem says something along the lines of: we want to visit each of 25 cities once and...
  6. Replies
    2
    Views
    2,651

    Thank you. I was confused on how to insert the...

    Thank you. I was confused on how to insert the call functions, but that's because I didn't really know what a header file was.
  7. Replies
    2
    Views
    2,651

    Splitting source code files

    I have a program that I want to split into two separate source code files, plus a single header file. The first source file should just have the main function that takes care of the input and calls...
  8. Replies
    1
    Views
    10,782

    Getchar terminating with new line or EOF

    Hi,

    I'm writing some code using the getchar function. The program should get the input character by character (using getchar) and ending when a new line character 'n' is reached or the EOF...
Results 1 to 8 of 8