In our Learn Logical Thinking and Programming Series -1, we are going to discuss about the below aptitude. This is one of the easiest logical thinking questions, usually asked in Aptitude rounds during interviews.
Aptitude:
The sum of age of 5 children born at interval of 3 years each is 50 years. Find out Who is the youngest child?
Solution:
let us assume that, 1st child will be x, 2nd child will be x+3, 3rd child will be x+6, 4th child will be x+9 and
5th child will be x+12.
The given Clue is -Sum of ages of 5 children = 50
Thus, we can say that x+x+3+x+6+x+9+x+12 = 50
i.e.., 5x+30 = 50
x = (50 – 30)/5, which is 4.
Now We will find this can be found using Java Program below.
Learn Logical Thinking through Programming:
public class YoungestChild {
public static void main(String[] args) {
int noOfchildren=5;
int age=50;
int interval=3;
int min=0;
for(int i=0;i<noOfchildren;i++)
{
min=min+(interval*i);
}
min=(age-min)/noOfchildren;
System.out.println(“Youngest age:”+ min);
}
}
OUTPUT:
Youngest age: 4