Computer Science, asked by aditya5746, 11 months ago

program to calculate reverse of a no.​

Answers

Answered by gnapithanl
1

import java.util.Scanner;

class reverse

{

public static void main(String args[])

{

Scanner sc=new Scanner(System.in);

System.out.println("enter the number to be reversed");

int n = sc.nextInt();

int r=0;

while(n!=0)

{

r=n%10+r*10;

n=n/10

}

System.out.println("reversed number:"+r);

}

}

this is ur answer please mark as brainliiest

Similar questions