### Learn basis JAVA,Python,.Net from start for beginner

• Teacher
• Category
###### Programaming
• Review
• (768 Reviws)

# Program to reverse a number

###### Java program to reverse a number
```import java.util.*;
class Main {
public static void main(String args[])
{
int reverse=0;
Scanner s = new Scanner(System.in);
System.out.println("Please Enter number: ");
int i = s.nextInt();

while(i!=0){
reverse = reverse*10 + i%10;
i=i/10;
}
System.out.println("Number after reverse : "+reverse);
}
}

```
###### Output:

Please Enter number:
1224
Number after reverse : 4221

###### Python program to reverse a number
```reverse=0;
i=int(input("Please Enter number: "));

while(i!=0):
reverse = reverse*10 + i%10;
i=i//10;

print("Number after reverse : ",reverse);

```
###### Output:

Please Enter number:
1224
Number after reverse : 4221

###### C# program to reverse a number
```

class Program
{
static void main(String args[])
{
int reverse=0;

Console.WriteLine("Please Enter number: ");
int i = Convert.ToInt32(Console.ReadLine());

while(i!=0){
reverse = reverse*10 + i%10;
i=i/10;
}
Console.WriteLine("Number after reverse : "+reverse);
}
}

```
###### Output:

Please Enter number:
1224
Number after reverse : 4221

###### C program to reverse a number
```

void main()
{
int reverse=0;

printf("Please Enter number: ");
scanf("%d",&i)

while(i!=0){
reverse = reverse*10 + i%10;
i=i/10;
}
printf("Number after reverse : %d",reverse);
getch();
}

```
###### Output:

Please Enter number:
1224
Number after reverse : 4221

#### Course Features

• Duaration(Core & Advanced) : 90 Hours
• Leactures : 90
• Quizzes : 60
• Interview Questions : 600
• Important Programs: 300
• Seminars: 20