subject

Write a program which asks the user to enter an integer. Your program should then display the sum of the even digits of the integer. A typical run would be: Enter an integer greater than 10000: 34 34 is not greater than 10000 Enter an integer greater than 10000: 39428 The sum of the even digits of 39248 is: 14 Hints: Use a loop to ensure that the number entered is > 10000. You don’t need to be concerned with the length of the integer, use a while loop which ends when the number is equal to zero. You will need to preserve the original value entered, so after the user enters it, copy it to another int variable. You can access the last digit of an integer by dividing modulo by 10, eg digit = workingNumber % 10; You can remove the last digit of an integer by dividing by 10, eg workingNumber /= 10;

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 06:00
What makes myhexadecimalnumber a child of mynumber? which methods does myhexadecimalnumber inherit directly from the mynumber class? what can an instance of the mynumber class do? what can an instance of the myhexadecimalnumber class do? which methods are overridden? why are they overridden? how many examples of overloading are there? why was this done? where is the super keyword used? what is it doing? why isn’t the incoming value set immediately in the second myhexadecimalnumber constructor? how many examples can you find of an inherited method being called?
Answers: 1
question
Computers and Technology, 23.06.2019 07:00
What are three software programs for mobile computing?
Answers: 1
question
Computers and Technology, 23.06.2019 22:30
Janice usually works on a particular workbook that contains all business related data. she decides to keep a backup of all the data in a separate workbook. she opens a new workbook to transfer the data. which option should she use to copy all the data from one workbook to another workbook?
Answers: 1
question
Computers and Technology, 24.06.2019 01:30
Write a program that asks the user to enter the name of an input file. if the file does not exist, the program should prompt the user to enter the file name again. if the user types quit in any uppercase/lowercase combinations, then the program should exit without any further output.
Answers: 3
You know the right answer?
Write a program which asks the user to enter an integer. Your program should then display the sum of...
Questions