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
Which relation is created with the primary key associated with the relationship or associative entity, plus any non-key attribut
konstantin123 [22]

Answer:

- Transform binary or unary M:N relationship or associative entity with its own key.

Explanation:

Transform binary relation is described as the method through which a decimal can easily be converted into binary while the unary relationship is described as a relationship in which both the two participants occurs from the same entity.

In the given case, 'transform binary or unary M:N relationship' can be created using 'the primary key linked with the relationship plus any non-key aspects of the relationship and the primary keys of the related entities' as it displays the existence of a relationship between the occurrences of a similar set of the entity i.e. associative entity here.

5 0
3 years ago
The variety of theatre introduced in the 1960s that denotes semi-professional or even amateur theatre in the New York/Manhattan
antoniya [11.8K]

Answer:

The answer is letter A. TRUE

Explanation:

The variety of theatre introduced in the 1960s that denotes semi-professional or even amateur theatre in the New York/Manhattan area, often in locations such as church basements, YMCAs, and coffeehouses, is commonly known as off-off-Broadway.  This statement is true.

3 0
3 years ago
8.10 Code Practice Question 3
Alchen [17]

terms = ["Bandwidth", "Hierarchy", "IPv6", "Software", "Firewall", "Cybersecurity", "Lists", "Program", "Logic",

        "Reliability"]

def swap(arr, in1, in2):

   w = arr[in1]

   arr[in1] = arr[in2]

   arr[in2] = w

print(terms)

swap(terms, 5, 1)

swap(terms, 2, 4)

swap(terms, 3, 5)

swap(terms, 5, 6)

swap(terms, 6, 8)

swap(terms, 8, 9)

print(terms)

This is how I interpreted the question. If I need to make any changes, I'll do my best. Hope this helps though.

4 0
2 years ago
Please explain what steps you will take to prevent hackers from getting access to your personal information.
yuradex [85]
The steps I would take are 1. Making a strong password with symbols and numbers. 2. I will set up a 2 way authentication ther for if someone would be trying to hack me I would get an alert in order to stop the attempt. 3 I will not use the same password each time.
4 0
3 years ago
What is a new ransomware program that encrypts your personal files and demands payment for the files' decryption keys? Multiple
frosja888 [35]

Answer: Simple-locker

Explanation:Simple-locker is the program that works on the technique in which it automatically encrypts the data or files and then demand a certain ransom or money from the user for the decryption of that data. It works on the function to gain the ransom or incentive in the financial form.

The decryption can only be carried out in safe way when the victim has the key to decrypted data or file.

5 0
3 years ago
Other questions:
  • 10 10 105 Each process is assigned a numerical priority, with a higher number indicating a higher relative priority. In addition
    8·1 answer
  • 1. Potential incidents represent threats that have yet to happen. Why is the identification of the threat important to maintaini
    6·1 answer
  • Can u suggest me some Hindi movies that is on you-tube please suggest
    7·2 answers
  • Are one of the greatest features of Photoshop that allow nondestructive editing of images.
    6·1 answer
  • Compare GBN, SR, and TCP (no delayed ACK). Assume that the timeout values for all three protocols are sufficiently long such tha
    11·1 answer
  • Wireless networks use radio frequency (RF) or radio techniques, which allows wireless transmissions to reach out in all directio
    6·1 answer
  • Which is the purpose of adding B-Roll footage to a sequence?
    10·1 answer
  • Two time series techniques that are appropriate when the data display a strong upward or downward trend are ___________ and ____
    14·1 answer
  • Which code will print a random number between 1 and 100?
    15·2 answers
  • Enterprise storage systems typically use fast Fibre Channel or ____ connections and are scalable so more hard drives can be adde
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!