0 votes 0 votes for( i = n, j = 0; i > 0; i /= 2, j +=i ) Why There is no condition check for j here Algorithms programming-in-c programming-in-c + – aka 53 asked Nov 26, 2017 aka 53 377 views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply AskHerOut commented Nov 26, 2017 reply Follow Share you can declare as many variables in for as you want. You will check conditions based on your requirement. Here the writer might not want j to act as a control variable governing the number of times loop runs so he didnt apply any condition check which indeed is perfectly normal. 1 votes 1 votes Ashwin Kulkarni commented Nov 26, 2017 reply Follow Share Here loop control variable is “i” , i will stop after logn times . In that time j will increase upto logn. 0 votes 0 votes aka 53 commented Nov 27, 2017 reply Follow Share I am not getting how this loop will execute Pls give one example for any value of n 0 votes 0 votes Please log in or register to add a comment.