There are 8 billiard balls, and one of them is slightly
heavier, but the only way to tell was by putting it on a
weighing scale against another. What's the fewest number of
times you'd have to use the scale to find the heavier ball?
Answers were Sorted based on User's Feedback
Answer / mahesh t
first take 6 balls from 8 balls
from those 6 divide 3 and 3 check it in weighing scale if it
equals weight remaining 2 balls and you get the hevier
ball....of not equals take the 3 balls which is hevier from
those weighing with 6 balls then take 2 balls from those 3
balls and weight if equals the remaining one is hevier
and final you can know the hevier ball within 2 times
Is This Answer Correct ? | 8 Yes | 0 No |
Simplify the program segment if X = B then C ← true else C ← false
if a five digit number is input through the keyboard, write a program to calculate the sum of its digits. (hint:-use the modulus operator.'%')
What is a method in c?
52.write a “Hello World” program in “c” without using a semicolon? 53.Give a method to count the number of ones in a 32 bit number? 54.write a program that print itself even if the source file is deleted? 55.Given an unsigned integer, find if the number is power of 2?
25 Answers Datamatics, Solartis, TCS, ThinkBox, Trine,
array contains zeros and ones as elements.we need to bring zeros one side and one other side in single parse. ex:a[]={0,0,1,0,1,1,0,0} o/p={0,0,0,0,0,1,1,1}
what would be the output of the follwing struct st { char name[20]; int i; float f; }; main() { struct st emp = {"forum"}; printf("%d %f",emp.i,emp.f); }
plz answer.... write a program that reads line (using getline) e.g."345", converts each line to an integer using "atoi" and computes the average of all the numbers read. also compute the standard deviation.
what is the use of bitfields & where do we use them?
Can we declare function inside main?
what is the difference between postfix and prefix unary increment operators?
Why is it usually a bad idea to use gets()? Suggest a workaround.
why should i select you?