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
4. WiFi and WiMax are used for a high-speed wireless access technology.
nikdorinn [45]

Answer: Wifi and WiMax are used to create wireless network connections.

Explanation: Wifi and WiMax are used to create wireless network connections. Wifi is used to create small networks and used to connect printers, computers, gaming consoles. WiMax uses spectrum to deliver connection to network. WiMax is used to provide internet services such as Mobile Data and hotspots.

8 0
3 years ago
Which of the following is the primary difference between analog and digital communication?
AVprozaik [17]

Answer:

Radio signal vs. microwave signal.

Explanation:

it's the suitable but again it's a weak answer to compare analog from digital signals

7 0
3 years ago
Read 2 more answers
The disk drive is a secondary storage device that stores data by ________ encoding it onto circular disks.
MrRissso [65]
Physically encoding it.
4 0
4 years ago
A number of LC-3 instructions have an "evaluate address" step in the instruction cycle, in which a 16-bit address is constructed
hjlf

Answer: you want to list all LC structers

Explanation:

4 0
4 years ago
Define a function that takes two arguments: a string called strText and a number called intNumber. This function will use a repe
natima [27]

Answer:

public class Main

{

   public static void printString(String strText, int intNumber) {

       for(int i=0; i<intNumber; i++){

           System.out.println(strText);

       }

   }

   

public static void main(String[] args) {

       

       printString("Brainly", 3);

}

}

Explanation:

- Define a function called <em>printString</em> that takes two parameters - a String and an int. Since the function will print out the given String, it's type will be <u>void</u>.

- Use <em>for loop</em> to iterate according to the given number and print the given string

- In the main, call the <em>printString </em>function with some parameters.

3 0
4 years ago
Read 2 more answers
Other questions:
  • Assume that a program consists of integer and floating-point instructions. 60% of the total execution time is spent on floating
    7·1 answer
  • You friends parents are worried about going over their budget for the month. Which expense would you suggest is NOT a need?
    10·1 answer
  • Operating systems such as Microsoft Windows use a specific character before a file extension to separate it from the filename. W
    9·2 answers
  • Henry is troubleshooting a network connection and wants to see if he can connect to the server on his network. Which Microsoft c
    14·1 answer
  • The bluecross blueshield federal employee program (fep) is a(n) __________ health benefits program established by an act of cong
    8·1 answer
  • Match the items with their respective descriptions. denotes row numbers denotes cell addresses denotes worksheets denotes column
    10·1 answer
  • Provide the definition for each of the following structures and unions:
    8·1 answer
  • Consider a system running ten I/O-bound tasks and one CPU-bound task. Assume that the I/O-bound tasks issue an I/O operation onc
    14·1 answer
  • What are the determinants of price elasticity of demand?​
    11·2 answers
  • Write a program, TwoDimentionalGrid. Ask the user to enter the size of the 2 dimensional array. Here we are not doing any input
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!