Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write a program to display numeric value in reverse order.
Ex: I have given a number like 7584, It should display in
reverse order like 4857.

Answer Posted / selvi

import java.util.Scanner;

public class IntReverseOrder
{
public static void main(String args[])
{
Scanner scan = new Scanner(System.in);
int num = scan.nextInt();
StringBuffer sb = new StringBuffer();
int remainder;

while(num>0)
{
remainder = num%10;
sb = sb.append(remainder);
num = num/10;

}
System.out.println("Reverse Order = "+sb);
}

}

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

J2ee is a container centric architecture. Explain.

908


What does the web module contain?

952


How will you explain load() and get() methods?

991


Describe secure socket layer (ssl)?

995


How do I become an expert in java?

958


Difference between load and get method?

959


How many types of constructors are there in java?

841


What is iso 3166?

993


Is java procedural or object oriented?

877


What is general entity?

941


What is Document Object Model?

1004


What is jta and jts?

921


What is setfocusable in java?

1104


What is meant by applet in java?

1067


what is direct link to download swing ebook,applet,ejb,core java

2578