Coding output

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • marmar12
    New Member
    • Mar 2008
    • 11

    Coding output

    int X (int m);
    int Y (int n);
    int main ()
    {
    int r, s;
    r = X (5);
    s = Y (10);
    printf ("main: %d %d\n"), r, s);
    return 0;
    }
    int X (int m)
    {
    printf ("X: %d\n", m);
    return (m + 2);
    }
    int Y (int n)
    {
    printf ("Y: %d %d\n", n, X (n));
    return (n * 3);
    }

    --given the above code, i tried running it, but it wouldn't compile. I've fixed it to the best i can, but still wont compile. I'm guessing the output would print 7, 21?

    Please help, thank you.
  • jonniethecodeprince
    New Member
    • Mar 2007
    • 35

    #2
    Originally posted by marmar12
    int X (int m);
    int Y (int n);
    int main ()
    {
    int r, s;
    r = X (5);
    s = Y (10);
    printf ("main: %d %d\n"), r, s);
    return 0;
    }
    int X (int m)
    {
    printf ("X: %d\n", m);
    return (m + 2);
    }
    int Y (int n)
    {
    printf ("Y: %d %d\n", n, X (n));
    return (n * 3);
    }

    --given the above code, i tried running it, but it wouldn't compile. I've fixed it to the best i can, but still wont compile. I'm guessing the output would print 7, 21?

    Please help, thank you.
    There are still a lot of things wrong with the code above have another look at it

    but i don't think it would come up with 7 and 21 either way

    Comment

    Working...