• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can anyone explain this program briefly

 
sunil langeh
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I have also a doubt in Line 1 about for loop syntax, Can be use both conditional and increment/decrement operator together??
 
sunil langeh
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sunil langeh wrote:

I have also a doubt in Line 1 about for loop syntax, Can be use both conditional and increment/decrement operator together??


Sorry,,Got it from k&B Book
 
Prav sharma
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sunil langeh wrote:

I have also a doubt in Line 1 about for loop syntax, Can be use both conditional and increment/decrement operator together??


Its an example of valid syntax.
 
Sachin Adat
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you can!!!

Any other doubt?
 
sunil langeh
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sachin Adat wrote:Yes you can!!!

Can be use both conditional and increment/decrement operator together??
 
sunil langeh
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Sachin
 
sunil langeh
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sunil langeh wrote:Thanks Sachin

Sachin one more thing, What will be the flow of for loo if we use both operators together,,Compiler firstly looks on condition or on increment/decrement?
 
Sachin Adat
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sunil langeh wrote:Compiler firstly looks on condition or on increment/decrement?

Depends if it is post or pre. In this case its pre-increment, so it will first increment then check the condition.
 
sunil langeh
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic