• Post Reply Bookmark Topic Watch Topic
  • New Topic

output not understanding  RSS feed

 
Carolin Sha
Ranch Hand
Posts: 68
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

please see code below, when I run this program the out put is 0011213242
I do not understand how to get this output, any help would be appreciated.


 
Knute Snortum
Sheriff
Posts: 4274
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First pass: y = 0 - 0 = 0
Second pass: y = 1 - 0 = 1
Third pass: y = 2 - 1 = 1
Fourth Pass: y = 3 - 1 = 2
etc.
 
Campbell Ritchie
Marshal
Posts: 56529
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will have to go through your loop bit by bit, counting the value of x and y at each stage. You would find it easier to understand if you posted the exact output including x= and y=.
 
Carolin Sha
Ranch Hand
Posts: 68
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, please see my output in detail.
test.JPG
[Thumbnail for test.JPG]
 
Knute Snortum
Sheriff
Posts: 4274
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks great!
 
Liutauras Vilda
Sheriff
Posts: 4917
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Carolin Sha wrote:please see my output in detail.
Indeed awesome technique. Works pretty much always. Have a cow
 
Carolin Sha
Ranch Hand
Posts: 68
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot for the help, much appreciated.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!