Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Flow control (For loop)

 
vinita Kh
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the following code y its prints out
"Total 0"
instead of
"i=0 ; j =10"
"i=1" : j = 9"
"i = 2 :j = 8"
"Total 30"

[ Added UBB CODE tags ]
[ May 07, 2002: Message edited by: Jessica Sant ]
 
Ashish Hareet
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The total at the start of the for loop is less than 30 ( zero ) so the code never get's into the for loop & you get zero as your output .
Ashish
 
vinita Kh
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oops!!
very silly mistake!
thanks Aashish.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic