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
If you play gta and don't know the song ''Glamorous'' Then what do you even do when you play?
Paraphin [41]
You literally don’t do anything you’re just like dead of sun
4 0
2 years ago
Read 2 more answers
Monero is cryptocurrency that focuses on transparency of ownership. True or false
dangina [55]

Answer:

TRUE

Explanation:

4 0
2 years ago
An audit trail is a record of how a transaction was handled from input through processing and output
Nostrana [21]

The answer is : True.  An audit trail is a record of how a transaction was handled from input through processing and output.  An audit trail is the evidence, such as purchase orders and invoices, that a financial transaction actually occurred.

6 0
3 years ago
Which of the following is an online library?
Mice21 [21]
Answer A. Hope it helped c:
4 0
3 years ago
Read 2 more answers
If you want to distribute a formatted Microsoft word document to people who don't have word save it as a __file
Helga [31]
If you want them only to read it and not change it send as a .pdf else I would send as a .txt file. Hope that helps
5 0
3 years ago
Other questions:
  • When using a wireless mouse, what is the most common port used for the transmitter? 
    7·1 answer
  • write a function that takes a string as parameter, return true if it’s a valid variable name, false otherwise. You can use keywo
    6·1 answer
  • Why does brainly keep saying “oops... something went wrong! Try again”
    7·2 answers
  • What kind of software is Microsoft Outlook??
    15·2 answers
  • Why are the social and ethical consequences of emerging technology hard to
    10·1 answer
  • Memory cache is referred to as ______. A. SRAM c. SROM b. DRAM d. DROM
    11·1 answer
  • What is project management? A. Brainstorming ways to plan a project B. Executing, completing, and revising a project C. Managing
    10·1 answer
  • How do you loop a makebeat in earsketch
    11·1 answer
  • List all the steps used to search for 25 in the sequence given below. Use both (a) linear search and (b) binary search. 2, 7, 13
    7·1 answer
  • Select all the correct answers.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!