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
How does the action affect the end result of what you want to accomplish?
suter [353]

Whichever action you take to complete a task will inevitably affect the end result of whatever would need to be accomplished; whether this impact the task in a positive or a negative way.

3 0
3 years ago
What are important requirements for a frame of reference to identify an object's location, and to communicate that location to a
gogolik [260]

Answer:  Set a scale, or method of determining distance, within your system. Identify an origin near an object—specifically something fixed.

Explanation:

4 0
3 years ago
Discuss advantages and disadvantages of os
Serhud [2]

Answer:

Advantages :

Management of hardware and software

easy to use with GUI

Convenient and easy to use different applications on the system.

Disadvantages:

They are expensive to buy

There can be technical issues which can ruin the task

Data can be lost if not saved properly

Explanation:

Operating system is a software which manages the computer. It efficiently manages the timelines and data stored on it is considered as safe by placing passwords. There are various advantages and disadvantages of the system. It is dependent on the user how he uses the software.

5 0
3 years ago
Match The Following <br><br> i need more characters to ask a question. Fun
8090 [49]

answer:

1 image

6 transition

7 word art

5 smart art

4 table

3 theme

2 slide

i hope this is whrite and i hope this helped you

4 0
3 years ago
Saitama vs Goku Vs Luffy Vs Natsu Vs Trunks Vs Piccolo (Who would win and why)?
mamaluj [8]
This is actually a question?? Lol anywayyyy can I get ?
5 0
3 years ago
Read 2 more answers
Other questions:
  • 5. Write a program to remove any duplicate letters from a word and display the new word maintaining the original order. For exam
    12·1 answer
  • What do we call a subset of new media in which groups and their fans can interact directly?
    14·1 answer
  • Write a static method named anglePairs that accepts three angles (integers), measured in degrees, as parameters and returns whet
    10·1 answer
  • Over the past three hours the pressure has been steadily increasing at a rate of what
    6·1 answer
  • Press the _______ key to move to the next cell in a row.
    5·1 answer
  • Claire writes a letter to her grandmother, in which she describes an amusement park she visited last week. She adds pictures of
    13·1 answer
  • Write a function in Java to implement the following logic:
    13·1 answer
  • Lasses give programmers the ability to define their own types. <br><br> a. True<br> b. False
    10·1 answer
  • Design an Application called Student Course Management create interface called Student Course add an abstract method called ad C
    10·1 answer
  • What is meant by editing a document​
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!