Q:

Calculate reverse the give number using Java

0

This Program is used to calculate reverse the given number using Java

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

// reverse the number 

import java.io.*; 
class ssvrev 
{ 
public static void main(String args[]) throws IOException 
{ 
int num; 
BufferedReader ip = new BufferedReader(new InputStreamReader(System.in)); 
System.out.println("\n\t\t\tREVERSING THE GIVEN DIGIT"); 
System.out.print("\n\n\tNumber: "); 
num = Integer.parseInt(ip.readLine()); 
System.out.print("\n\n\n\t\tReversed Didits: "); 
do 
{ 
int t = num % 10; 
System.out.print(t); 
num = num / 10; 
} while(num>0); 
System.out.println(); 
} 
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now