1 1 vote How many times does the while loop gets executed if the following function is called as $f(120,13)?$ f(m,n) { ans := 1 while (m - n >= 0) { ans := ans * 2 m := m - n } return(ans) } Programming in C + – Nulu Madhu 970 views answer comment Share Follow Print See all 3 Comments 3 3 Comments reply Lakshman Bhaiya commented Dec 14, 2018 reply Follow flag ans$=512$ and while loop executed $9$ times 1 1 replyShare Nulu Madhu commented Dec 14, 2018 reply Follow flag Please explain 0 0 replyShare Lakshman Bhaiya commented Dec 14, 2018 i edited by Lakshman Bhaiya Dec 14, 2018 reply Follow flag ok please, you can also try to trace out. check the answer 0 0 replyShare Please log in or register to add a comment.
Best answer 1 1 vote Making a tree diagram is easy to understand. Lakshman Bhaiya answered Dec 14, 2018 • edited Jan 8, 2019 by Lakshman Bhaiya Lakshman Bhaiya comment Share Follow 0 reply Please log in or register to add a comment.
2 2 votes Just 120/13=9.23 just take floor value which is 9 answer Yash4444 answered Jan 18, 2020 Yash4444 comment Share Follow 0 reply Please log in or register to add a comment.