12 comments:

  1. import java.util.Scanner;

    class Test{

    public static void main(String ar[])
    {

    Scanner sc=new Scanner(System.in);
    int num,hold=0,rev=0;
    System.out.println("Enter Number");
    num=sc.nextInt();
    while (num > 0)
    {
    hold=num%10;
    rev=(rev*10)+hold;
    num/=10;
    }
    System.out.println("Reversed Number = "+rev);
    }
    }

    ReplyDelete
  2. import java.util.Scanner;

    class Test
    {

    public static void main(String ar[])
    {
    double number,new_number=0;
    int number1;
    System.out.print("Enter the number: ");
    Scanner o= new Scanner(System.in);
    number=o.nextDouble();
    number1=(int)number;
    while(number1>0)
    {
    new_number=new_number*10+(number1%10);
    number1=number1/10;
    }
    System.out.println("The reverse of the number is: "+new_number);

    }
    }

    ReplyDelete
  3. import java.util.Scanner;
    class ReverseNumber
    {
    public static void main(String ar[])
    {
    int Number,RNumber=0;
    Scanner scan=new Scanner(System.in);
    System.out.println("Enter thee Number you want ot reverse");
    Number=scan.nextInt();
    while(Number>0)
    {

    RNumber=RNumber*10+(Number%10);
    Number=Number/10;

    }
    System.out.println("Reverse Number="+RNumber);
    }
    }

    ReplyDelete
  4. import java.util.Scanner;
    import java.lang.Math;
    class Reverse
    {
    public static void main(String Args[])
    {
    System.out.println("enter the integer");
    Scanner sc=new Scanner(System.in);
    int num=sc.nextInt();
    int rev_num=0;
    while(num>0)
    {
    int digit=num%10;
    rev_num=rev_num*10+digit;
    num/=10;
    }
    System.out.println("reverse="+rev_num);
    }
    }

    ReplyDelete
  5. $num1=$_POST["num"];
    $temp=$num1;
    $reverse=0;
    if($temp%10==0)
    echo "Reverse of $num1= 0";
    while($temp>=1)
    {
    $reverse=$reverse*10+$temp%10;
    $temp/=10;
    }
    echo "$reverse
    ";

    ReplyDelete
  6. 11.
    import java.util.Scanner;
    class A
    {
    public static void main(String args[])
    {
    Scanner obj=new Scanner(System.in);
    int num;
    num=obj.nextInt();
    int reverse=0;
    int remainder;
    while(num>0)
    {
    remainder=num%10;
    reverse=reverse*10+remainder;
    num=num/10;
    }
    System.out.println("The reverse of the number is ="+reverse);
    }
    }

    ReplyDelete
  7. import java.util.Scanner;

    class reversenum
    {
    public static void main(String ar[])
    {
    Scanner num = new Scanner(System.in);
    int reverseno = 0 , remainder , no , temp;
    System.out.println("Enter the number to be reversed");
    no = num.nextInt();
    temp = no;
    while(no>0)
    {
    remainder = no % 10;
    reverseno = reverseno*10+remainder;
    no/=10;
    }
    System.out.println("the orginal number is : " +temp);
    System.out.println("the reverse number is : " +reverseno);

    }
    }

    ReplyDelete
  8. import java.util.Scanner;

    class reversenum
    {
    public static void main(String ar[])
    {
    Scanner num = new Scanner(System.in);
    int reverseno = 0 , remainder , no , temp;
    System.out.println("Enter the number to be reversed");
    no = num.nextInt();
    temp = no;
    while(no>0)
    {
    remainder = no % 10;
    reverseno = reverseno*10+remainder;
    no/=10;
    }
    System.out.println("the orginal number is : " +temp);
    System.out.println("the reverse number is : " +reverseno);

    }
    }

    ReplyDelete
  9. import java.util.Scanner;
    class Reverse{
    public static void main(String ar[]){
    Scanner obj=new Scanner(System.in);
    int num,rem;
    System.out.println("enter the number");
    num=obj.nextInt();
    while(num!=0)
    {
    rem=num%10;
    num=num/10;
    System.out.print(rem);
    }
    }
    }

    ReplyDelete
  10. import java.util.Scanner;
    class Reverse{
    public static void main(String ar[]){
    int number,remainder=0,i,digit;
    Scanner scan=new Scanner(System.in);
    System.out.println("ENTER A NUMBER");
    number=scan.nextInt();
    while(number!=0)
    {
    digit=number%10;
    remainder=(remainder*10)+digit;
    number=number/10;
    }
    System.out.println("REVERSE OF THE NUMBER ENTERED IS = "+remainder);
    }
    }

    ReplyDelete
  11. import java.util.Scanner;
    class Rev{
    public static void main(String ar[]){
    Scanner s=new Scanner(System.in);
    int num,rev=0;
    System.out.println("enter the number");
    num=s.nextInt();
    while(num>0)
    {
    rev=rev*10+(num%10);


    num=num/10;
    }
    System.out.println("num is: "+rev);
    }
    }

    ReplyDelete
  12. public class ReverseNumber {

    public static void main(String[] args) {

    int num = 1234567, reversed = 0;

    for(;num != 0; num /= 10) {
    int digit = num % 10;
    reversed = reversed * 10 + digit;
    }

    System.out.println("Reversed Number: " + reversed);
    }
    }

    ReplyDelete