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
frosja888 [35]
3 years ago
8

Write an application that asks a user to type an even number or the sentinel value 999 to stop. When the user types an even numb

er, display the message "Good job!" and then ask for another input. When the user types an odd number, display an error message, "x is not an even number", and then ask for another input. When the user types the sentinel value 999, end the program
Computers and Technology
2 answers:
Alisiya [41]3 years ago
6 0

Answer:

int value;

while(1){

scanf("%d\n", &value);

if(value == 999)

break;

if(value%2 == 0)

printf("Good job");

else if(value%2 == 1)

printf("%d is not an even number", value);

}

Explanation:

I am going to write a C code for this.

The while(1) runs until the break command. So

int value;

while(1){

scanf("%d\n", &value);

if(value == 999)

break;

if(value%2 == 0)

printf("Good job");

else if(value%2 == 1)

printf("%d is not an even number", value);

}

yan [13]3 years ago
3 0

Answer:

 do{

    std::cout << "input an even number: ";

    std::cin >> n;

    even=n%2;

    if (even==0)

    std::cout << "Good job!\n";

    else

    std::cout << n <<" is not an even number\n";

    }while(n!=999);

Explanation:

#include <iostream>

#include <string>

int main()

{ int n=0,even;

 do{

    std::cout << "input an even number: ";  //print on screen to input the number

    std::cin >> n;  //put that value on n variable

    even=n%2;

    if (even==0)  //if even is zero the number is even

    std::cout << "Good job!\n";

    else  //if even is not zero the number is odd

    std::cout << n <<" is not an even number\n";

    }while(n!=999);  // we will repeat the proccess while n is diffrente from 999

}

You might be interested in
When you tap or click the ____ button for a selected graphic, Word provides options for changing how a graphic is positioned wit
Snowcat [4.5K]
<span>You have to click on "layout options" to enable you to change the positioning of a graphic within a Word document. You will be able to change how the graphic wraps around text, is scaled to the page/document and if it should have borders etc around it.Hope this helps. Let me know if you need additional help!</span>
5 0
3 years ago
g 1-1 Which network model layer provides information about the physical dimensions of a network connector like an RJ45
Harlamova29_29 [7]

Answer:

Physical layer

Explanation:

OSI model stands for Open Systems Interconnection. The seven layers of OSI model architecture starts from the Hardware Layers (Layers in Hardware Systems) to Software Layers (Layers in Software Systems) and includes the following;

1. Physical Layer

2. Data link Layer

3. Network Layer

4. Transport Layer

5. Session Layer

6. Presentation Layer

7. Application Layer

Each layer has its unique functionality which is responsible for the proper functioning of the communication services.

In the OSI model, the physical layer is the first and lowest layer. Just like its name physical, it addresses and provides information about the physical characteristics such as type of connector, cable type, length of cable, etc., of a network.

This ultimately implies that, the physical layer of the network (OSI) model layer provides information about the physical dimensions of a network connector such as a RJ45. A RJ45 is used for connecting a CAT-5 or CAT-6 cable to a networking device.

8 0
3 years ago
To use an outline for writing a formal business document, what should you
nydimaria [60]

Answer: D. enter each major point from the outline on a separate line

6 0
3 years ago
1. How does inertia affect a person who is not wearing a seatbelt during a collision?
Ivenika [448]
They could go flying out the window, getting seriously injured. This could also leave to death.
5 0
3 years ago
Read 2 more answers
Florescent lights tend to emit less of what color?
Olin [163]
I believe it emits more yellow, it can even be blue or green 
4 0
3 years ago
Other questions:
  • You are researching RAM for a computer you are building for a friend who will be using the system as a home office server for he
    13·1 answer
  • What term is used for a seemingly harmless program that has malicious code hidden inside?
    9·1 answer
  • What is a grant cycle?
    15·2 answers
  • What is secondary exchange ? - Apex
    14·1 answer
  • Which of the following illustrates an example of a Boolean data type?
    15·1 answer
  • What are the values of the following expressions? In each line assume that,
    7·1 answer
  • An employee sets up an automation that transfers files in a specific folder on their PC to a remote drive for archiving, provide
    11·1 answer
  • Why do software developers prefer to use high-level language to author programs?
    8·1 answer
  • How to change the microsoft word pages to black background
    8·1 answer
  • Smart art is considered a​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!