1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
PolarNik [594]
3 years ago
10

4. Write an interactive program CountOddDigits that accepts an integer as its inputs and prints the number of even-valued digits

in that number. An even-valued digit is either 1, 3, 5, 7, or 9. For example, the number 8546587 has four even digits (the two 5s, and a 7). So the program CountOddDigits(8546587) should return "The number of Odd Digits in 8546587 is 3".
Computers and Technology
1 answer:
levacccp [35]3 years ago
4 0

Answer:

Program :

number=int(input("Enter the number: "))#take the input from the user.

number1=number

count=0#take a variable for count.

while(number>0):#loop which check every number to be odd or not.

   value=number%10 #it is used to take the every number from integer value.

   number=int(number/10)#it is used to cut the number which is in the use.

   if(value%2!=0):#It is used to check the number to be odd.

       count=count+1#It is used to increase the value.

print("The number of Odd Digits in "+str(number1)+" is "+str(count))#It is used to print the count value of odd digit.

Output:

  • If the user inputs is '1234567890', it will prints "5".
  • If the user inputs is "8546587", it will prints "3".

Explanation:

  • The above program is in python language, which takes the integer value from the user.
  • Then The number will be distributed into many individual units with the help of a while loop.
  • The while loop runs when the number is greater than 0.
  • There is a two operation, one is used to take the number by the help of modulo operator because it gives the remainder.
  • The second operation is used to divide the number to let the number 0.
You might be interested in
Help please<br>x + 1 = –x + (–5)​
blsea [12.9K]

Explanation:

x + 1 =  - x + ( - 5) \\ x + 1 =  - x - 5 \\ x + x =  - 1 - 5 \\ 2x =  - 6 \\  \\ x = -   \frac{6}{2}  \\  \\ x =  - 3

4 0
3 years ago
What happens if part of an ftp message is not delivered to the destination?
Oliga [24]

The message is lost when an FTP message is not delivered to its destination because FTP doesn't use a reliable delivery method.

<h3>What is FTP?</h3>

FTP is an abbreviation for file transfer protocol and it can be defined as a type of server that's designed and developed to store and provide files for download, as well as sharing between two or more users on an active computer network.

Generally, the message is lost when an FTP message is not delivered to its destination because FTP doesn't use a reliable delivery method.

Read more on FTP here: brainly.com/question/20602197

#SPJ12

4 0
2 years ago
Which of the following can you use to attach external hardware devices to a computer?
Genrish500 [490]

The answer is c that what a lot of people use☻

5 0
3 years ago
Read 2 more answers
Consider the following sequence, defined from n=2 to 15 (inclusive). Pn=n2−1. Produce a list named primes which only contains va
omeli [17]

Answer:

primes = []

for n in range(2,16):

   pn = n*n - 1

   if is_prime(pn):

       primes.append(pn)

5 0
3 years ago
E-banking is also called: [1]
DENIUS [597]
Answer 1 it’s online banking
3 0
3 years ago
Other questions:
  • Which function can you use to abbreviate the lengthy expression, A1+A2+A3+A3...+A19+A20?  MAX COUNT SUM ROUND
    10·2 answers
  • Assume that isIsosceles is a bool variable, and that the variables isoCount, triangleCount, and polygonCount have all been decla
    11·1 answer
  • Effective presentations vary the color scheme on each slide.
    7·2 answers
  • What type of Internet monitoring technique records information about a customer during a web surfing session, such as what websi
    8·1 answer
  • Determine the number of cache sets (S), tag bits (t), set index bits (s), and block offset bits (b) for a 1024-byte 4-way set as
    5·1 answer
  • Can Algorithms Be Used Again?
    8·1 answer
  • What kind of skill is persuasion?
    7·1 answer
  • Which activity is the best example of a negative habit that may result from
    12·1 answer
  • computer is an electronic machine that is used for data processing to produce meaningful information explain in statement​
    5·1 answer
  • Choose the answer.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!