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
Even though the Pizza Hut corporation understood the need to make use of the Web, the franchise owners were skeptical. From an I
Gelneren [198K]

Answer:

Franchise owners are essential stakeholder group whose opinions are directly related to the company's success.

Explanation:

Franchise owners are essential stakeholder groups. A stakeholder is a person, organization, social group. A stakeholder can be internal or external to the business. Stakeholders affected by business and affect the business.

Different type of stakeholder is

  • Customer
  • Employees
  • Investors
  • Suppliers
  • Owners

Pizza Hut corporation owner is a stakeholder whose opinions are related to the company's success.

8 0
4 years ago
How do I insert a row above the selected row in between row and row 2 revenue xls
Scorpion4ik [409]
I believe you go to the the tools selection or just click control alt space 
5 0
3 years ago
Question 5 (2 points)
Scrat [10]

Answer:

B) 5 m/s

Explanation:

Took the test and this was the correct answer :)

6 0
3 years ago
Why does dns use udp instead of tcp? if a dns packet is lost, there is no automatic recovery. what are the consequences?
inysia [295]
<span>If a DNS packet using UDP is lost this problem must be handled at the application layer. If an answer is not received after some period of time the specific application may choose to resend the DNS query. I can go much more into detail but this should answer your question. If you need more detail just ask.</span>
6 0
3 years ago
computer hardware without software is useless while computer software without hardware is meaningless. explain what do you under
Rainbow [258]

Answer:

That the software is useless

Explanation:

6 0
3 years ago
Other questions:
  • You’re responsible for an always-on VPN connection for your company and have been told that it must utilize the most secure mode
    12·1 answer
  • We say that a sequence of numbers is a palindrome if it is read the same backward or forward. For example, the sequence: 6, 15,
    11·1 answer
  • Give several reasons why Python is such a great programming language. Explain how Python is related to flowcharts. (students mak
    9·1 answer
  • What conclusion did Freud reach when attempting to understand the connection between psychological and physical problems?
    12·1 answer
  • Does the brain play a role in smartphone addiction
    7·2 answers
  • Why is redundancy of data undersirable?
    7·2 answers
  • I’m trying to make the button change random colors every time you hover over it, yet I can’t seem to understand the procedure...
    8·1 answer
  • Can someone plzzzzzzz help
    14·2 answers
  • An interactive online representation of geospatial data, which can be accesses via a Web browser is a(an): a. Web Application b.
    11·1 answer
  • An Accenture healthcare client is interested in implementing an Artificial Intelligence (AI) solution to improve patient care, b
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!