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
Gekata [30.6K]
3 years ago
9

Write a C++ program that allows the user to enter double values. Display one of two messages: "The first number you entered is l

arger", "The second number you entered is larger". Save file as LargerorNot.cpp
Computers and Technology
1 answer:
VikaD [51]3 years ago
7 0

Answer:

Following are the program in c++

#include <iostream> // header file

using namespace std; // namespace

int main() // main function

{

double a,b; // variable declaration

cout<<"Enter the first number and second number : \n";

cin>>a>>b; // input the number

if(a>b) // check first number greater than second number

{

cout<<"The first number you entered is larger";

}

else

{

cout<<"The second number you entered is larger";

}

return 0;

}

Output:

Enter the first number and second number :

45.5

687.8

The second number you entered is larger

Explanation:

In this program we have declared two variable i.e a and b of double type. After that check the condition if(a>b) if this condition is true then display  the message "The first number you entered is larger " otherwise display the message  "The second number you entered is larger".

You might be interested in
what are the main technologies that have contributed to be growth and commercialization of the Internet
iren [92.7K]

hope it helps have a good day

5 0
2 years ago
Explain how can we determine that where is the strength of magnetic force maximum in a
snow_lady [41]

Answer:

by making a experiment

Explanation:

8 0
2 years ago
Compare computer virus and worm ​
Zina [86]

Answer:

You can say they're somewhat alike, since a worm wiggles into a tight spot, just like how a computer virus wiggles into your computer-

Hope this helps-

7 0
3 years ago
Read 2 more answers
In this lab, you complete a C++ program that swaps values stored in three int variables and determines maximum and minimum value
Sergio039 [100]

Answer:

Following are the code to the given question:

#include <iostream>//header file

using namespace std;

int main()//main method

{

int first = 0,second = 0,third = 0;//defining integer variable  

int temp; //defining integer variable

const string SENTINEL = "done"; // defining a string variable as constant  

string repeat;// defining a string variable  

bool notDone = true; //defining bool variable

cout << "Enter first number: ";//print message

cin >> first;//input value

cout << "Enter second number: ";//print message

cin >> second;//input value

cout << "Enter third number: ";//print message

cin >> third;//input value

while(notDone == true)//defining a loop to check the value  

{

if(first > second)//use if to compare first and second value

{

int temp = first;//defining temp to hold first value

first = second;//holding second value in first variable

second = temp;//holding temp value in second variable

}

if(second > third)//use if to compare second and third value

{

int temp = second;//defining temp to hold second value

second = third;//holding second value in third variable

third = temp;//holding temp value in third variable

}

cout << "Smallest: " << first << endl;//print smallest value

cout << "Next smallest: " << second << endl;//print Next smallest value

cout << "Largest: " << third << endl;////print Largest value

cout << "Enter any letter to continue or done to quit: ";//print message

cin >> repeat;//holding string value

if (repeat == SENTINEL)

{

notDone = false;//holding bool value

}  

else //else block

{

cout << "Enter first number: ";//print message

cin >> first;//input value

cout << "Enter second number: ";//print message

cin >> second;//input value

cout << "Enter third number: ";//print message

cin >> third;//input value

}

return 0;

}

}

Output:

Please find the attached file.

Explanation:

  • Inside the main method Four integer variable "first, second, third, and temp" is declared in which first three variable is used for input value and temp is used to compare value.
  • In thew next step, two string variable "SENTINEL and repeat" is declared in which "SENTINEL" is constant and a bool variable "notDone" is declared.
  • After input the value from the user-end a loop is declared that compare and swap value and print its value.

6 0
2 years ago
While a computer is running the operating system remains in memory. true or false?
MrMuchimi
While a computer is running the operating system remains in memory is true.
8 0
3 years ago
Other questions:
  • A(n) _________ is any system resource that is placed onto a functional system but has no normal use for that system. If it attra
    15·1 answer
  • Exercise 4: Bring in program grades.cpp and grades.txt from the Lab 10 folder. Fill in the code in bold so that the data is prop
    12·1 answer
  • PLEASE HELP!!!!
    6·2 answers
  • On what menu in Microsoft Word can you locate the Macro feature?
    10·1 answer
  • Refer to the image on the right. Then, using the drop-down menu, identify the correct printer type. A: inexpensive home printer
    10·1 answer
  • Ask how many apples the user wants. Ask how many people the user will share the apples with. Find out how many apples will remai
    7·1 answer
  • An if statement must always begin with the word “if.” True False python
    15·2 answers
  • Write a list comprehension that creates a list containing the numbers that result from the values 1 through 10 being multiplied
    15·1 answer
  • Blockquote
    11·1 answer
  • How long will the plant have been dead when 87.5 percent of its C-14 has become N-14?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!