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
Does any of yall know how to delete your account?
il63 [147K]

Answer:

No i really don't but why would you want to delete your account

8 0
2 years ago
Can someone be my friend please i will accept you
astra-53 [7]
I will be your friend
4 0
3 years ago
Read 2 more answers
Give two relative advantages of the GUI over the CL
Juliette [100K]

Answer:

GUI (Graphic User Interface) Can be used for images whereas CL Focuses on Text Imports

Info:

Here's One Try To Finish It With The Other

3 0
2 years ago
A corporate office has a huge number of employees. Every employee has a telephone next to their computer so that they can call o
Lemur [1.5K]

Answer:

PBX system.

Explanation:

PBX is an acronym for private branch exchange. It is a private telephone network service that allows users to communicate by making or taking inbound and outbound calls using a gateway, voice mail, transfer calls, call queues and recording.

In an office, employees having a PBX telephone can call other employees in the same office regarding official work.

The callers have to dial a particular extension number so that the intended receiver gets the call.

Example of an extension number is 111-5001 and 111-5002, with a central number as 111-5000.

Hence, the telephone network used in this office is the PBX system.

5 0
3 years ago
Which of these file formats would you choose if you had to create a very small and compact raster image for a website?
NikAS [45]

Answer:

Not (png)

sdfgsershntynmjeg

7 0
3 years ago
Other questions:
  • What does the security element of non-repudiation mean in e-commerce cybersecurity? A. Data needs to be available at all times.
    10·1 answer
  • Discuss in detail why you need to use a write blocker (either hardware or software) in your examinations, whether for a criminal
    6·1 answer
  • John's Plumbing prides itself on excellent customer service, especially during after-hours service calls. They want to connect w
    11·1 answer
  • Match the challenge with the term or process that offers a solution.
    6·1 answer
  • 60 POINTS!
    13·1 answer
  • The acceleration of a body is 3 metre per second square what does it mean​
    11·2 answers
  • Describing light years
    7·1 answer
  • Code the function definition for aNonclassFunction, picking up co. aNonclassFunction has no return value.
    8·1 answer
  • The Circle and CircleTester have been created, but they have errors. The public and private settings for variables and methods a
    8·1 answer
  • Question 1
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!