Skip to content

Commit 5c920e8

Browse files
oop-lab-10
1 parent 4d8ec8b commit 5c920e8

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

com oop-lab/lab-10

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import java.util.Scanner;
2+
3+
public class lab10 {
4+
public static void main(String[] args)
5+
{
6+
Scanner sc=new Scanner(System.in);
7+
System.out.println("enter the number");
8+
int a=sc.nextInt();
9+
int r,rev = 0;
10+
11+
while(a!=0)
12+
{
13+
r=a%10;
14+
rev=rev*10+r;
15+
a=a/10;
16+
}
17+
System.out.println("the reverse number is "+rev);
18+
}
19+
}

0 commit comments

Comments
 (0)