Since a #90^(@)# angle is involved, we can use #Pythagorean Theorem to help solve this.
The whole setup looks something like this. Since we are just trying find the magnitude, the direction the boy walks does not really matter here.
The boy walks #3" km"#. Then, he walks #4" km"#, making a #90^(@)# turn. The displacement would be the shortest distance from the start and finish points. This is our resultant vector, or the displacement. The magnitude of the resultant vector in this case would be #5" km"#. But do keep in mind displacement is a vector quantity, meaning it has a magnitude and a direction.
#color(green)barul"Pythagorean Theorem"#
#color(blue)("a") = color(blue)("3 km"),color(red)("b") = color(red)("4 km")#

#color(blue)(a^2)+color(red)(b^2)=color(orange)(c^2)#

#3^2+4^2 = color(orange)(c^2)#

#25 = color(orange)(c^2)#

#5 = color(orange)c#
#"Answer": 5" km"#