Quantcast

Maximum PC

It is currently Thu Apr 24, 2014 4:05 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: For the dude...
PostPosted: Thu Oct 21, 2004 5:32 pm 
Clawhammer
Clawhammer
User avatar

Joined: Sat Jun 26, 2004 2:16 pm
Posts: 3600
int x=1;
int z;
while (x<5({
if(x%2==0)
for(int z=3; z>0; z--, x++)
cout<<x*z<<endl;
if(x==5)
z=2;
x++;
}

I have to trace the code and type the output and what line it changes.


Top
  Profile  
 
 Post subject:
PostPosted: Thu Oct 21, 2004 6:06 pm 
I judge you GUILTY!
I judge you GUILTY!
User avatar

Joined: Tue May 25, 2004 4:38 pm
Posts: 162
Location: New York City
The final state when the progam is ran is:
x 1 2 3 4 5 6
z 3 2 1 0 2

This is the output
Code:
6
6
5


Top
  Profile  
 
 Post subject:
PostPosted: Fri Oct 22, 2004 2:35 am 
Bitchin' Fast 3D Z8000*
Bitchin' Fast 3D Z8000*
User avatar

Joined: Tue Jun 29, 2004 11:32 pm
Posts: 2555
Location: Somewhere between compilation and linking
Dude-X wrote:
This is the output
Code:
6
6
5

Shouldn't that last cout be x=4 * z=1?


Top
  Profile  
 
 Post subject:
PostPosted: Sat Nov 06, 2004 8:00 pm 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000

Joined: Mon Jun 14, 2004 2:50 pm
Posts: 45
Location: Rochester, NY
Gadget wrote:
Shouldn't that last cout be x=4 * z=1?


I concur.


Top
  Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group