Program questions
Program questions
Write a program in Java to input a three-digit number and display their sum of
the digits.
2. Write a program in Java to input a two-digit number and display sum of the
digits' square.
3. Write a program in Java to input two numbers and check the last two digits are
equal or not with a suitable message.
4. Write a program in Java to input a number and check if it is five digit and if
it is divisible by nine or not.
5. Write a program in Java to input a three-digit number and display if the sum of
the cube of all the digits are equal to the number or not.
6. Write a program in Java to input a three-digit number and check sum of the
product of digits and sum of digits are equal to the number or not.
7. Write a program in Java to input a three-digit number and display its reverse
number.
8. Write a program in Java to assign three unequal numbers and display the greatest
number among them.
9. Write a program in Java to assign three unequal numbers and display the smallest
number among them.
10. Write a program in Java to input CP and SP of a book and display if it is
profitable or loss with the amount.
11. Write a program in Java to input Principal amount, Rate of Interest and Time.
Display the Amount.
12. Write a program in Java to input Salary of Mr. Rahul. He spends 30% in
household, 20% in books, 23% in other expenditures and rest
of it he puts in into his savings. Display the all the expenditures and savings
amount.