Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Write a description of class Variables here.
- *
- * @author (Lucky Shahin)
- * @version (17-09-2019)
- */
- public class Variables
- {
- public int reverse(int num){
- if(num>99 && num<1000){
- int lastNum = num%10;
- num = num/10;
- int midNum = num%10;
- num = num/10;
- int firstNum = num%10;
- int result = lastNum*100+midNum*10+firstNum;
- return result;
- }else{
- System.out.println("You should input 3 digit numbers!");
- return 0;
- }
- }
- public int square(int num){
- if(num>99 && num<1000){
- int kuadNum = num * num;
- return kuadNum;
- }else{
- System.out.println("You don't input 3 digit numbers!");
- return 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement