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]
2 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]2 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
Kayla wants to know whether she should set her network up as a WAN or a LAN. What are the three questions you would ask her, and
Ann [662]
Due to it's typically massive size, WAN's are almost always slower then a LAN. The further the distance, the slower the network. One of the big disadvantages to having a WAN is the cost it can incur. Having a private WAN can be expensive.
3 0
2 years ago
Write a Java program that accepts an integer number from the user between 20 and 100. Next, divide the number by 12 and determin
Eddi Din [679]
Import java.util.Scanner;
class hola
{
public static void main(String[]args)
{
Scanner x=new Scanner(System.in);
int a=x.nextInt();
int b;
if(a>20&&a<100)
{
b=a%12;
if(b%2==0){
System.out.print("es par"+b);
}
else{
System.out.print("es impar"+b);
}
}
}

}
4 0
3 years ago
File names should describe what is in the file in a few words
JulijaS [17]

Answer

File names should describe the content of the file.

Explanation

File names are set of words  which are used to uniquely identify computer files which are stored in a file system. This helps one to know the contents of the file which you want to find. When you name these file names you use necessary characters you use descriptive words so that you dont have hard times when searching for them. The naming also is determined by the file system you are using because different systems impose different restrictions on the length of the file names and the allowed characters within file names.

3 0
3 years ago
What is the term for the era created by the digital revolution?
Ahat [919]
Technological innovation
8 0
3 years ago
With which game is shigeru miyamoto associated
Juliette [100K]

Answer: Mario, Donkey Kong, and Legend of Zelda.

To be honest those are not the only games that Shigeru Miyamoto is associated with, but these are the games that he is most known for. Shigeru Miyamoto is a video game designer and producer who works for the Nintendo company.

These games mentioned are just some of the games that he helped produce for the company. He started working for the Nintendo company on 1977 and helped with the production of multiple games after joining the company. He initially started working in the Nintendo company as a manga artist, but then moved on to help design and produce different video games.

4 0
3 years ago
Other questions:
  • Is a network traffic management device used to connect different network segments together?
    9·1 answer
  • To copy noncontiguous slides, open Slide Sorter view, click the first slide thumbnail, press and hold ____, click each additiona
    15·1 answer
  • Any parameter that receives a value and also sends a value outside the function must be declared as a reference parameter.
    8·1 answer
  • What is our goal for a hashing function?
    14·2 answers
  • "The effectiveness of memory retrieval is directly related to the similarity of cues present when the memory was encoded to the
    11·1 answer
  • Averigua las diferentes intensidades, la potencia total y el gasto en € (de un mes de 30 días con el equipo conectado todo el ti
    12·1 answer
  • Why are Quick Parts useful in an Outlook message?
    5·1 answer
  • Please help fast
    5·1 answer
  • Rebbeca has finished with the research and outline portion of her slide presentation. Now, the next logical step is to begin wor
    11·1 answer
  • Software that converts program written in other language into machine language​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!