Sunday, February 20, 2011

How to reverse a number in java


Java code to reverse a given number


import java.io.*;



class Test {

public static void main(String[] args) throws IOException {



int num,sum=0,r;

System.out.println("Enter a number");

BufferedReader br=new BufferedReader(new InputStreamReader (System.in));

num=Integer.parseInt(br.readLine());



while(num!=

No comments:

Post a Comment