Ask Experts Questions for FREE Help !
Ask
    lelandcollins27's Avatar
    lelandcollins27 Posts: 1, Reputation: 1
    New Member
     
    #1

    Sep 27, 2008, 03:50 PM
    need program answered
    int secret(int x)
    {
    int I, j;
    I = 2 * x;
    if (I > 10)
    j=x/2;
    else
    j = x/3;
    return j - 1;
    }
    int another (int a, int b)
    {
    int I, j;
    j = 0;
    for (I = a; I <=b; I++)
    j = j + I;
    return j;
    }


    what is the output of the following segments
    a. x=10
    cout << secret(x) << endl;

    b. x=5; y=8;
    cout << another(x,y) <<endl;

    c. x=10; k=secret(x);
    cout << x << " " << k <<" " << another (x,k) <<endl;

    d. x=5; y=8;
    cout << another(y,x) <<endl;
    iFire's Avatar
    iFire Posts: 39, Reputation: -1
    Junior Member
     
    #2

    Oct 10, 2008, 11:22 AM

    Where would the cout's be..

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Just need something answered [ 7 Answers ]

If you are married and you have another child with another man. And you know who the father is of that child. Is the man your married to responsible for that child until he is 18 years old? I heard something along the lines that the man your married to is responsible for that child because she is...

Need this answered for application [ 2 Answers ]

The question is : Describe any work you have done that you feel might be valuable preparation For being a teachers assistant? First of all the only experience I have is with my own children, which I have seven of, so technically I have had experience with kids for 9 years. I understand that...

Many Questions To Be Answered! [ 4 Answers ]

1. Is it okay to tell the next relationship about how the old relationship went and to tell them who dumped who. Will any of it make a difference? 2. Is it possible for a very beautiful woman to really have guy friends that are just guy friends? 3. What are a few things to never ever say to a...


View more questions Search