Program for print reverse string of given number in java?

Java

1 answer

Answer

1129016

2026-08-08 14:41

+ Follow

public class StringReverseExample

{

public static void main(String[] args)

{

int num=1001;

int n=num, rev;

while(num!=0)

{

int d=num%10;

rev= (rev*10)+d;

num=num/10;

}

System.uot.println(rev);

}

}

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.