Ex_4CH_7 - num1 =reverseDigit(num System.out.println public...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.util.Scanner; import java.lang.*; import java.io.*; import java.text.*; import java.math.*; import java.text.DecimalFormat; import java.lang.String; // Jeremy Debruce // 2/18/2009 //Chapter 7 / public class Ex_4CH_7 { static Scanner Console = new Scanner(System.in); public static void main(String[] args) { int num,num1; int num2; System.out.println("Enter an integer"); num = Console.nextInt();
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: num1 =reverseDigit(num); System.out.println(); } public static int reverseDigit(int num) { int sum,num2; System.out.println(); num = Math.abs(num); num2 = num; sum = 0; do { num2 = (num % 10); System.out.print(num2); sum = sum + num2; num = (num / 10); num2 = (num % 10); } while (num > 0); System.out.println(); System.out.println(); return (num); } }...
View Full Document

This note was uploaded on 06/17/2011 for the course COMP 2302 taught by Professor Staff during the Spring '11 term at Kennesaw.

Ask a homework question - tutors are online