Faizan and Hamza are brothers. In three years, Hamza will be five years younger than two time’s Faizan’s current age. Write a Java program to calculate and display Hamza’s age
public class Main {
public static void main(String[] args) {
for (int x = 0; x < 200; x++) {
for (int y = 0; y < 200; y++) {
if (x + 3 == 2 * y - 5) {
System.out.println(x);
System.exit(0);
}
}
}
}
}
Comments
Leave a comment