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
Give the 16-bit 2's complement form of the following 8-bit 2's complement numbers: (a) OX94 (b) OXFF (c) OX23 (d) OXBCWhich of t
Korvikt [17]

Answer:

Answer is provided in the explanation section

Explanation:

Convert 8-bit 2’s complement form into 16-bit 2’s complement form.

First write value in binary then check for 8 th bit value. If it is positive the upper 8 bits will  be zero otherwise will be 1s.

8-bit number   Binary of number    Insert 8 bits                  16-bit number

0X94                1001-0100                 1111-1111-1001-0100            0XFF94

0XFF                1111-1111                       1111-1111-1111-1111                 0XFFFF

0X23                0010-0011                 0000-0000-0010-0011    0X0023

0XBC               1011-1100                    1111-1111-1011-1100              0XFFBC

Which of the following 16-bit 2’s complement form can be shortened to 8-bits?

16-bit number        8-bit number

0X00BA                  0XBA

0XFF94                   MSB bits are not zero so we can’t  truncate it to 8-bit No

0X0024                  0X24

0XFF3C                   MSB bits are not zero so we can’t  truncate it to 8-bit No

4 0
3 years ago
The analysts at Techno Info Systems are considering the four-model approach to system development for a new client. If they make
luda_lava [24]

Answer:

B

Explanation:

...if they make use of the four-model approach, the time taken to develop the model would increase.

Cheers

5 0
4 years ago
Finish the code where it says //YOUR CODE HERE
victus00 [196]

Answer:This is basically the issue of permutations and calculations. It revolves around the best depiction of accuracy.

Explanation: It hitherto explains the nitty-gritty of our day-to-day activities in connection with our social interactions and securities...

6 0
3 years ago
Also known as the hard disk, the ______ is the primary storage device of a personal computer. You can also buy an external _____
Stolb23 [73]

Another name for hard disk is called; Hard Drive

The external hard disk is called; External Hard drive

<h3>Computer storage devices</h3>

In computers there are different ways of storing information and all could come under the name drives but the primary storage of a computer which is called hard disk is also called hard drive.

Now, the hard drive could be internal or external and so the one to store additional information is called External Hard Drive.

Read more about Computer Storage Devices at; brainly.com/question/19667078

5 0
2 years ago
List the actual network numbers for each of these subnets. (If the list is longer than 16, simply list the first 3 and final 3 "
Andre45 [30]
69 is the answer because I know or it could be 430
3 0
3 years ago
Other questions:
  • Show the contents of a queue after the following operations are performed. Assume the queue is initially empty. enqueue(45); enq
    6·1 answer
  • Which type of operating system is usually used in personal computers
    13·1 answer
  • The idea that managers tend to communicate more with other managers who share similar beliefs and experiences is represented by
    8·1 answer
  • You might have trouble interpreting a message if:
    15·1 answer
  • Which UML relationships should be used between a subclass and a superclass? For example, suppose there is an interface or abstra
    5·1 answer
  • বর্তমান করােনার ন্যায় পরিস্থিতি অর্থাৎ স্বাভাবিক শ্রেণি কার্যক্রম পরিচালনা সম্ভব
    10·2 answers
  • Away message:
    14·2 answers
  • 7.4 code practice question 1 edhesive
    15·2 answers
  • Raw materials have two basic types what are the 2?
    11·2 answers
  • To meet the requirement for the number of vdss on board, what must be true about pyrotechnic vdss?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!