Click here to Skip to main content
13,447,852 members (54,140 online)
Rate this:
Please Sign up or sign in to vote.
See more:
7. Trace the following program. For this tracing assignment, the column headings are provided for you. As always, follow the tracing guidelines as specified in the Homework Assignment Guidelines document.

#include <iostream>
using namespace std;
int main()
    int x, y;
    cout << x + y << endl;
    for (x=12, y=1; x>0; x/=2)
        if (x   3)
            cout << x + y << endl;
        cin >> y;

input x y output

Posted 7-Feb-13 15:01pm
Updated 7-Feb-13 15:23pm
SoMad 7-Feb-13 21:25pm
I formatted the code for you (something you can do yourself by selecting the text and marking it with the appropriate programming language selection). Take a look at your code again and see if you can spot the error(s).

Soren Madsen

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

It's your homework. If I do it I get the credit and that means you get to work for me for the rest of your life for no money. So I'm going to leave it for you to do and if anyone else does it for you I'm going to report them.
I hope that's clear enough.
kanku2 7-Feb-13 22:48pm
If you want me to pay, we can talk this over.
Argonia 8-Feb-13 8:48am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04-2016 | 2.8.180318.3 | Last Updated 7 Feb 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100