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
aniked [119]
2 years ago
6

How to write a C++ program that lets the user guess if a randomly generated integer is even or odd then the computer lets them k

now if they are correct or incorrect
Computers and Technology
1 answer:
Evgen [1.6K]2 years ago
6 0

#include <iostream>

using namespace std;

int main() {

 string input;

 string rand_type;

int number=rand()%100+1; //number between 1 and 100

if ( number % 2 == 0)

   rand_type= "even";

 else

  rand_type="odd";

 cout << "your guess: ";

 cin >> input;

 if ( input== rand_type)

   cout << "correct.\n";

else

   cout << "incorrect.\n";

 return 0;

}

You might be interested in
5. A Disk defragmenter tool does what to a computer HDD?
Ivenika [448]

Answer:It rearranges the files on a hard drive to get quicker access to them.

5 0
3 years ago
Which of the following allows data to coordinate activity between devices? Select one: a. Address bus b. Collisions c. Data bus
AnnyKZ [126]

Answer:

The correct option is D: Control Bus

Explanation:

A control bus is usually used by the Central Processing Unit to communicate with all the devices that are connected or contained within a computer. This connections are usually done via physical connections such as printed circuits or cables. It is also called a Computer bus and helps in coordinating activities between the connected devices.

5 0
3 years ago
Which best describes Sayid’s error?
Sonja [21]
<span>Change "move only through matter" to "move through space and matter."</span>
8 0
3 years ago
The Internet may best be compared to a/an
Usimov [2.4K]
A volcano because its always erupting
3 0
3 years ago
is an interviewing method in which a mall interviewer intercepts and directs willing respondents to nearby computers where each
geniusboy [140]

Answer:

computer-assisted self-interviewing

Explanation:

Based on the description of the interviewing method that is being provided, it can be said that this method is known as computer-assisted self-interviewing. Like mentioned in the question this is when interviewees answer the interview questions through a computer screen. This is similar to telephone interviews but it is instead through a computer.

3 0
3 years ago
Other questions:
  • Who would be a member of the American Dental Association?
    10·1 answer
  • Assign testResult with 1 if either geneticMarkerA is 1 or geneticMarkerB is 1. If geneticMarkerA and geneticMarkerB are both 1,
    11·1 answer
  • Creating a chart using a spreadsheet Chart Wizard involves four steps. Which is the last step?
    6·1 answer
  • A(n) _____ is a request for the database management software to search the database for data that match criteria specified by th
    15·2 answers
  • Im getting hit offline can someone help or give me some advice
    6·1 answer
  • I need a utube name for a gaming channel....PLEASE HELP...BRAINLIEST
    5·1 answer
  • When hacking a website to test a secure connection and ensure internet safety, what is a good way to check the coding of the web
    14·1 answer
  • An application's certificate indicates the application -
    5·1 answer
  • _is the joining of two or more electrical conductors by mechanically twisting the conductors together or by using a special spli
    8·1 answer
  • you are setting up an active directory environment for a business that has three locations and 300 users. you want the users to
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!