How's this an error? can you help me find out please.
thanks!
thanks!
Code:
import java.io.*; import java.lang.*; public class ReverseTheNumber{ public static void main(String []args)throws IOException{ BufferedReader in=new BufferedReader(new InputStreamReader(System.in)); try { int num; DataInputStream in= new DataInputStream(System.in); System.out.println("Reverse the Numbers:"); num=Integer.parseInt(in.readLine()); int len=String.valueOf(num).length(); int[] digits= new int[len]; int i=0; while( num !=0){ digits[i++]=num% 10; num/=1000; } for(i=0;i<digits.length;i++) System.out.print(digits[i]); } catch(IOException e){} } }
Comment