Quiz-4
Analytics below shows your performance in various Mocks on PrepInsta
Your average Analytics for this Quiz
Rank
-
Percentile
0%
Related Banners
Check out our instagram
PrepInsta Prime
Get over 200+ course One Subscription
PrepInsta Prime
Get over 200+ course One Subscription
Get PrepInsta Prime Subscription
Companies
TCS, Cognizant, Delloite, Infosys, Wipro, CoCubes, KPMG, Amazone, ZS Associates, Accenture, Congnizant & other 50+ companies
Programming
Data Structures, Top 500 Codes, C, C++, Java Python & other 10+ subjects
Skills
Full Stack Web Development, Data Science, Machine Learning, AWS Cloud, & other 10+ skills and 20+ projects
Companies
TCS, Cognizant, Delloite, Infosys, Wipro, CoCubes, KPMG, Amazone, ZS Associates, Accenture, Congnizant & other 50+ companies
Programming
TCS, Cognizant, Delloite, Infosys, Wipro, CoCubes, KPMG, Amazone, ZS Associates, Accenture, Congnizant & other 50+ companies
Skills
TCS, Cognizant, Delloite, Infosys, Wipro, CoCubes, KPMG, Amazone, ZS Associates, Accenture, Congnizant & other 50+ companies
Comments
Login/Signup to comment
Sir,there is a mistake in output of question 7,8, and 10 . Please correct them as soon as possible.
Yeah thanks Vishal, we got the mistake in Question 7, but could you please elaborate what is the mistake that you are finding in Question 8 and Question 10 ??
Sir, question 8 explanation is correct ,answer is infinte loop but on my screen it shows wrong .
There may be some glitch, please hard-refresh the particular page
Sir, in question 10 output should be “49 3 3” because b=50 and a=2.
At first while (b>9) –>true because 50>9
{ a= b%2 + a => 50%2 + 2=> 0+2=2;
if(a%2!=0) –> false and move to else part
else { print b-1 => 50-1=49}
b= b/2 => b=25 }
At second while (b>9) –>true
{ a= b%2 + a => 25%2 + 2=> 1+2=3;
if(a%2!=0) –> true{ print a => print 3}
b= b/2 => b=12 }
At third while (b>9) –>true
{ a= b%2 + a => 12%2+ 3=> 0+3=3;
if(a%2!=0) –> true{ print a => print 3}
b= b/2 => b=6 }
now b>9 =>false
so output will be 49 3 3
Hey Vishal, sorry for the silly mistake, we’ll fix it up