Write a C++ program to count even and odd numbers in array. The array size is 50. The array elements will be entered by the user.

Answers

Answer 1
Answer:

Answer:

The program in C++ is as follows:

#include <iostream>

using namespace std;

int main(){

   int numbers[50];

   int evekount = 0, odkount = 0;

   for(int i = 0; i<50;i++){

       cin>>numbers[i];

       if(numbers[i]%2==0){            evekount++;        }

       else{            odkount++;        }

   }

   cout<<"Even Count: "<<evekount<<endl;

   cout<<"Odd Count: "<<odkount<<endl;

   return 0;

}

Explanation:

This declares the integer array of number

   int numbers[50];

This initializes the even count and odd count to 0

   int evekount = 0, odkount = 0;

This iterates from 1 to 50

   for(int i = 0; i<50;i++){

This gets input for the array

       cin>>numbers[i];

This checks for even

       if(numbers[i]%2==0){            evekount++;        }

This checks for odd

       else{            odkount++;        }

   }

This prints the even count

   cout<<"Even Count: "<<evekount<<endl;

This prints the odd count

   cout<<"Odd Count: "<<odkount<<endl;


Related Questions

You can use Facebook's Live Feed tool to broadcast content as you post it, true or false?
Which of the following would NOT be considered a cause of technological progress?A. scientific research B. innovation C. patents D. large markets
The elements of an integer-valued array can be set to 0 (i.e., the array can be cleared) recursively as follows: An array of size 0 is already cleared; Otherwise, set the last of the uncleared elements of the array to 0, and clear the rest of the array Write a void method named clear that accepts an integer array, and the number of elements in the array and sets the elements of the array to 0.
How comfortable are you with short deadlines and new trends in a fast-paced environment?
What part of the computer can translate the words from the instructions into bit patterns the chip can understand?

What term defines Internet applications that help people connect with each other through a virtual environment by providing them with a collection of online tools?a. Blogs
b. Forums
c. Podcasts
d. Social networks

Answers

As for this problem, the most probable and the most likely answer to this together with the presented options would be D. Social Networks.

Social networks is the term that defines Internet applications that help people connect with each other through a virtual environment by providing them with a collection of online tools. These tools include the instant messaging, the uploading of pictures and other tools that is found useful in connecting with people online. This has become phenomenon and the most popular social network as of the moment would be Facebook.

What term is defined as software that allows users to use and adapt it for any purpose, often allowing the public to participate in further development?Responses

open well
open well

open source
open source

open use
open use

open pit

Answers

Final Answer

Open-source software is software with freely accessible source code, allowing users to view, modify, and redistribute it, fostering collaborative development and user customization.

Explanation:

Open-source software is a paradigm that champions transparency, collaboration, and community-driven development. At its core, open-source software refers to applications or programs for which the source code is made freely available to the public. This means that anyone can view, modify, and redistribute the code, often under specific licenses such as the GNU General Public License (GPL) or the MIT License.

The key feature of open-source software is that it empowers users to not only utilize the software for their needs but also adapt it to suit their specific requirements. This adaptability has numerous advantages. Firstly, it allows for widespread participation in the development process, as users can contribute improvements, bug fixes, or new features. This collective effort often results in software that is more reliable, secure, and feature-rich.

Open source projects can range from small utilities to massive, industry-defining applications. Prominent examples include the Linux operating system, the Apache web server, the Mozilla Firefox web browser, and the LibreOffice office suite. These projects have attracted a global community of developers and users who collaborate to enhance the software continually.

Moreover, open-source software often leads to a sense of ownership and engagement among its users. It empowers individuals, organizations, and entire industries to shape the software they rely on, reducing vendor lock-in and ensuring long-term accessibility and sustainability. Open source has become an essential component of modern software development, fostering innovation and democratizing access to technology.

Learn more about Open-source software

brainly.com/question/35869839

#SPJ11

The __________ is the system of official channels that carry organizationally approved messages and information.

Answers

Formal Communication Channels

Pick a number You will write a program that will simulate the game where two players try to guess a number and the one who's closest wins.
1. Random secret number from 1 to 10 or any larger range if you want.
2. Two players will guess
3. Determine who was closest.
4. Display the results of the round in a neat and organized fashion.
5. Add some kind of style to your print outs so that your display is nice

Answers

In python 3+:

import random

secret_number = random.randint(1,10)

guess_one = int(input("Enter player one's guess: "))

guess_two = int(input("Enter player two's guess: "))

if abs(guess_one - secret_number) < abs(guess_two - secret_number):

   print(f"The secret number is {secret_number} and player 1 was closest")

elif abs(guess_one - secret_number) > abs(guess_two - secret_number):

   print(f"The secret number is {secret_number} and player 2 was closest")

else:

   print(f"The secret number is {secret_number} and it was a tie")

I hope this helps!

Which of the following statements is​ FALSE? A. Security is a huge concern for nearly all organizations with private or proprietary information about​ clients, customers, and employees. B. New controls in​ e-mail programs can ensure that your​ e-mail will remain​ private, both within your​ organization's server and at the​ receiver's end as well. C. When writing​ e-mails, avoid jargon and​ slang, use formal​ titles, use formal​ e-mail addresses for​ yourself, and make your message concise and​ well-written. D. Lack of visual and vocal cues in​ e-mails means emotionally positive​ messages, like those including​ praise, will be seen as more emotionally neutral than the sender intended. E. ​Face-to-face communication provides the highest degree of message channel richness.

Answers

B is false, because once an e-mail is sent, the receiver can do what they wish with the contents of it (for example, screenshotting or taking a picture of it). There is no guarantee of privacy if you do not trust the recipient.

The therapist's feeling of respect and affection for the client that exists without any strings attached, no matter what the client may do or say, is called ____________.

Answers

Answer:Unconditional positive regard

Explanation:Unconditional positive regard is an expression of feeling  which is usually referred in the case that focuses on the client therapy mostly. It is the emotion that describes about a person having no expectation in return toward their feeling and being supportive and respectful towards the client.

The therapist is also displaying this emotion from his side towards the client irrespective of the client's emotion .