2:16 am - Tuesday April 23, 2019

Java Example Program to Reverse the Number

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044
//Java Example Program to Reverse the Number
/**
 * @author:candidjava.com
 * @description:Program to Reverse the Number
 */
public class Reverse {
	public static void main(String args[]) {
		int b;// take a variable to perform Reverse operation
		System.out.println("take a number=45");// //take a input value
		System.out.print("Reverse the Number is ");
		for (int a = 45; a > 0; a = a / 10)// condition for Reverse the number
		{
			b = a % 10;
			System.out.print(b);
		}
	}
}


output:
take a number=45
Reverse the Number is 54

Filed in: Z-A All Java Codes

Comments are closed.