SAP interview question

Write a Java program for a math problem