ahmed sami

ahmed sami

  • NA
  • 64
  • 199.9k

separates a number of 5 digits ..

Nov 2 2012 5:40 PM
Write an application that inputs one number consisting of five digits from the user, separates the number into its individual digits and prints the digits separated from one another by three spaces each. For example, if the user types in the number 42339, the program should print 
4   2   3   3   9
[You will need to use both division and modulus operations to "pick off" each digit.] For the purpose of this exercise, assume that the user enters the correct number of digits. What happens when you execute the program and type a number with more than five digits? What happens when you execute the program and type a number with fewer than five digits? 

Answers (3)