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
A(n) __________ is a popular way to describe relationships? (i.e., one-to-one,? one-to-many) in a relational database.
Leto [7]
A link is a popular way to describe relationships in a relational database.
There are three types of relationships (links) between tables:
1. One-to-one <span>relationship , that allows only one record on each side of the relationship.
2. </span>One-to-many <span>relationship, that allows a single record in one table to be related to multiple records in another table.
3. </span>Many-to-many<span> relationship, in which many records in a table can link to many records in another table. F</span>
6 0
3 years ago
Todays hard drives give up to or more than 1000gb of space. true or false
olya-2409 [2.1K]
Its true because most 2017 harddrives come with at least 250gb 
3 0
4 years ago
What allows you to navigate up, down, left and right in a spreadsheet?
Triss [41]
The formula bar......................
3 0
3 years ago
You are interested in buying a laptop computer. Your list of considerations include the computer's speed in processing data, its
eduard

Answer:

Order Qualifier

Explanation:

An order qualifier is the features of an organization's product or service that is very much necessary to be present for the product or service to even be considered by a buyer. On the other hand, order winners are those features that will win the purchase. From the question, the speed and monitor screen size are the order qualifiers, while the weight and price are the order winners.

5 0
3 years ago
4. What is the difference between portrait orientation and landscape orientation? (1.0 points)
Bezzdna [24]

Answer:

Portrait orientation is taller then it is wide, while landscape orientation is wider then it is tall.

Explanation:

3 0
4 years ago
Other questions:
  • By default, windows active directory creates __________ user accounts when a new domain is created
    8·1 answer
  • What is a different paragph formatting tools
    6·1 answer
  • Let’s say you are given a number, a, and you want to find its square root. One way to do that is to start with a very rough gues
    15·1 answer
  • Write a program that takes a date as input and outputs the date's season. The input is a string to represent the month and an in
    13·1 answer
  • Write a program that reads an integer, and then prints the sum of the even and odd integers.
    8·1 answer
  • Rob is planning his housewarming party. He wants to design an invitation and personalize it for each invitee. He needs to create
    11·1 answer
  • Which statement is most likely to be true about a computer network?
    12·2 answers
  • Update thejavafile names to include your initials at the end, send .java file only.1. Completein-place heapSort, which takes an
    11·1 answer
  • Daniel has a list of numbers that are not in any order. He wants to find the order of the numbers with the help of a spreadsheet
    10·1 answer
  • Define generation of computer ​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!