QR4 - n do { sum = sum + number%10; number = number / 10; }...

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

View Full Document Right Arrow Icon
// The "QR4" class. import apsc142.*; public class QR4 { public static void main (String[] args) { int number; int sum=0; i System.out.println ("Please enter integer"); number = StdIn.readInt ();
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: n do { sum = sum + number%10; number = number / 10; } while (number !=0); w System.out.println (sum); // Place your code here } // main method } // QR4 class...
View Full Document

Ask a homework question - tutors are online