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
Dafna11 [192]
3 years ago
6

Write a function which the counts the number of odd numbers and even numbers currently in the stack and prints the results.

Computers and Technology
1 answer:
Lerok [7]3 years ago
5 0

Answer:

See the code below and the algorithm explanation on the figure.

Explanation:

The explanation in order to get the answer is given on the figure below.

Solving this problem with C. The program is given below:

#include <stdio.h>

int main(void) {

   int n, Even=0, Odd=0, Zeros=0;  

   for (;;) {

       printf("\nEnter the value the value that you want to check(remember just integers): ");

       //IF we input a non-numeric character the code end;

       if (scanf("%d", &n) != 1) break;

       if (n == 0) {

           Zeros++;

       }

       else {

           if (n % 2) {

               Even++;

           }

           else {

               Odd++;

           }

       }

   }  

   printf("for this case we have %d even, %d odd, and %d zero values.", Even, Odd, Zeros);

   return 0;

}

You might be interested in
Microwave transmits information between network nodes using
tekilochka [14]

Answer:

Towers and satellite.

Explanation:

Electromagnetic waves is a propagating medium used in all communications device to transmit data (messages) from the device of the sender to the device of the receiver.

Generally, the most commonly used electromagnetic wave technology in telecommunications is radio waves.

Radio waves can be defined as an electromagnetic wave that has its frequency ranging from 30 GHz to 300 GHz and its wavelength between 1mm and 3000m. Therefore, radio waves are a series of repetitive valleys and peaks that are typically characterized of having the longest wavelength in the electromagnetic spectrum.

Basically, as a result of radio waves having long wavelengths, they are mainly used in long-distance communications such as the carriage and transmission of data.

The distance from one peak to the next peak is called wavelength. This distance is also equal to the distance from one trough of a wave to another.

Also, microwave is a form of radio waves which typically has short wavelengths and frequency ranging from 300 MHz and 300 GHz.

Hence, microwave transmits information between network nodes using towers and satellite.

7 0
3 years ago
Read 2 more answers
Which of the following tool tab have more than one related subordinate tab??
Juliette [100K]
Table tool? i think because it gives more info
8 0
3 years ago
Read 2 more answers
An administrator helps a user obtain an Internet connection through connecting a laptop with a smartphone via a cable. What has
frez [133]
The administrator set up tethering
8 0
3 years ago
Which of the following is not a mobile means of connecting devices to networks?
ElenaW [278]

Answer:

USB cables.

Explanation:

Think of what would happen if you started walking to a friend's house that is 3 houses away from yours. You have a cell and there are no others that you can see. Your friend calls you.

Could you hear what he says with a blue tooth earphone? Likely.

If you are connected by a wifi device. Again likely.

What about a broad band. That would be possible too.

So what about a USB cable. Now there's a problem. The cable would have to be at least 75 feet long (city plots are usually somewhere in the neighborhood of 25 feet wide). You would need an awfully long cable. And that's only 3 houses away.

6 0
3 years ago
Frank accidently overwrote his old document with a new document of the same name. He'd like to get his old document back. What f
Archy [21]

Answer:

the recycle bin?

Explanation:

usually when you overwrite something or delete it, it doesn't get entirely deleted rather stored in the recycle bin on your desktop i believe, and so you could retrieve applications through there

4 0
3 years ago
Other questions:
  • When Amy turns on her computer, she notices a burning smell. Smoke comes out of the case, and Amy immediately turns off her comp
    7·1 answer
  • Which of the following is not a characteristic of a motorcycle?
    6·1 answer
  • The endocrine system is composed of many parts of the body.<br> a)True<br> b)False
    11·2 answers
  • What two skills are most important for a meteorologist
    14·2 answers
  • Which of the following is NOT a period of the Middle Ages?
    10·1 answer
  • Demographics refers to
    7·1 answer
  • Ayuda no encuentro la información de estas tres preguntas:
    10·1 answer
  • 1. Would it be possible for two people to have the same email address? Explain.
    9·2 answers
  • As we move up a energy pyrimad the amount of a energy avaliable to each level of consumers
    10·1 answer
  • How dose computers it use the information to solve problems
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!