Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

reverse a integer in java

while(num != 0) 
{
   int digit = num % 10;
   reversed = reversed * 10 + digit;
   num /= 10;
}
 
PREVIOUS NEXT
Tagged: #reverse #integer #java
ADD COMMENT
Topic
Name
8+9 =