what will be the output of this program
void print (int n) { if (n>0) { printf(“hello”); print(n-1); } printf(“world”); }
void print (int n) { if (n>0) { printf(“hello”); print(n-1); } printf(“world”); }
by Rajat 3 Comments
Number Puzzle #90
A man had Rs.900 and brought some toys with all the money. Out of which 5 toys were defected. He sold all the remaining toys by increasing the price by Rs.2 and made a profit of Rs.80.
What is the no.of initial toys and the initial cost of toys?
Check your answer, Number of Toys:-
Check your answer, Initial Cost:-
Click here to See SolutionHide Solutionxy + 2x -5y -10= 900+80;
2x-5y = 90;
2x-5*900/x = 90
2x^2 -4500 = 90x;
x^2 -45x – 2250 = 0;
(x-75)(x+30) = 0;
x = 75 and x =–30, as number of toys cant be negative, initial number of toys were 75.
Initial Cost = 900/75 = Rs.12.
There is a one person who have two numbers, he tells sum to the person S and product of those numbers to P.
Now there is this conversion between S and P.
S: I don’t know what are the numbers.
P: I also don’t know what are the numbers.
S: Now i know what are the numbers.
P: Now i also know what are the numbers.
Assuming S and P to be very wise and good in mathematics, What are those two numbers?
Note: Numbers are greater than 0.
This is the second problem in Google Code Jam 2014, Round 1A
This problem is based on all time favorite of interviewers Binary Tree, you need to find out the minimum number of node to delete to make the given binary tree(in graph form, for any connection in X and Y, you can consider X as child of Y or vice verse) as Full Binary Tree.
[Read more…]
First problem in Google CodeJam 2014, Round 1A
Its about getting the minimum number of switch you need to do to get the desired electric flow.
[Read more…]
If Value of
Cow + Sheep = 240
Goat + Camel = 500
Camel – Sheep + Goat = 455
Cow + Goat = 215
Then what will be the value of Camel ?
Guess the movies from Whatsapp Emooticons, smileys and symbols
[Read more…]Guess the hindi songs from whatsapp emoticons, smileys and ninjas
[Read more…]What is 3/7 Chicken, 2/3 cat and 1/2 goat?