From 21eece93214d0e64b20adf91e36d75d22ec024fe Mon Sep 17 00:00:00 2001 From: parthiv11 <75653580+parthiv11@users.noreply.github.com> Date: Fri, 1 Oct 2021 21:37:51 -0700 Subject: [PATCH] Added a Java Program Reverse Number This Reverse The Input Number --- .../Java_Programs/Misc/ReverseNumber | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Program's_Contributed_By_Contributors/Java_Programs/Misc/ReverseNumber diff --git a/Program's_Contributed_By_Contributors/Java_Programs/Misc/ReverseNumber b/Program's_Contributed_By_Contributors/Java_Programs/Misc/ReverseNumber new file mode 100644 index 0000000000..04dbaf3904 --- /dev/null +++ b/Program's_Contributed_By_Contributors/Java_Programs/Misc/ReverseNumber @@ -0,0 +1,35 @@ + /* + Example of This Program Does . + + + input : 956 + output : 659 + */ + + + + + + import java.util.*; + + +public class ResverseNumber +{ + public static void main(String[] args) { +Scanner sc = new Scanner(System.in); + System.out.print("Enter Integer To Resvere it : "); + int n=sc.nextInt(); + sc.close(); + + + int result= 0; + + + while(n!=0){ + int remainder= n%10; + result =result*10 +remainder; + n=n/10; + + } + System.out.println ("Your result is "+ result); } +}