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
Jet001 [13]
2 years ago
14

Write a programme with C++ language wich print the biggest number in between three numbers , whith INT

Computers and Technology
1 answer:
belka [17]2 years ago
5 0
Your question is a bit misleading, I'm having trouble understanding what you mean with "in between". I'm assuming you want the biggest number from an input of 3 numbers. You did not specify what should happen if more than one number is the biggest (ie., they're equal).

A very naive implementation might be:

void PrintBiggest(int a, int b, int c)
{
   if ((a >= b) && (a >= c)) cout << a;
   else if ((b >= a) && (b >= c)) cout << b;
   else if ((c >= a) && (c >= b)) cout << c;
}

If you want to use STL (mine is a little rusty), the following could be the start of something more generic:

void PrintBiggest(int a, int b, int c)
{
   std::vector<int> myints;
   myints.push_back(a);
   myints.push_back(b);
   myints.push_back(c);
   sort(myints.begin(), myints.end());
   cout << myints.back();
}



You might be interested in
If you want to stop a loop before it goes through all of its iterations, the break statement may be used. Group of answer choice
NeX [460]

Answer:

Answer is true

Explanation:

6 0
1 year ago
Choose the true statement below. Question 8 options: A) The content that displays in the browser is contained in the head sectio
Rzqust [24]

Answer:

a. The content that displays in the browser is contained in the head section.

5 0
3 years ago
Why should you avoid the use of sarcasm, clichés, and idioms in business letters?
Alex

You should avoid those types of writing because it doesn't make you look like you are a professional.


hope this helps!

8 0
3 years ago
Read 2 more answers
4.5 Code Practice
Alex787 [66]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

This program is written in C++.

                                                                         

#include <iostream>

using namespace std;

int main()

{

   

   string word;// variable for taking user input

   int cond;// to set condition true if user preses the stop and exit from loop

   

   cout<<"Enter word: \n";

   cin>>word;

   do// start while loop

   {

       

       

       if(word=="stop" || word =="STOP" || word == "Stop")// if user enter word stop, then program exit

       {

       cond=0;

       

       }

       else//otherwise loop continue

       {

           cout<<" You Entered "+ word +"\n";

           cout<<"Enter word: \n";

           cin>>word;

           cond=1;

       }

   }  

   while(cond == 1);// if user don't enter word "stop" loop run continuesly.  

   cout<<"Program exit";

   

   return 0;

}

5 0
3 years ago
In java write a program:A contact list is a place where you can store a specific contact with other associated information such
BigorU [14]

Answer:

import java.util.Scanner;

public class ContactInformation

{

public static String GetPhoneNumber(String[] nameVec, String[] phoneNumberVec, String contactName, int arraySize)  

{  

for(int i=0;i<arraySize;i++)

{

if(nameVec[i].equals(contactName))  

return phoneNumberVec[i];

}  

return "Contact doesn't exists!";

}

public static void main(String[] args)

{

int records;

Scanner sc = new Scanner(System.in);

System.out.print("Enter the size of contact List :");

records=sc.nextInt();

String[] contactNameList=new String[records];

String[] phoneNumberList=new String[records];

String contactName;

System.out.println("Enter the contact name and phone number :");

for(int i=0;i<contactNameList.length;i++)

{  

contactNameList[i]=sc.next();  

phoneNumberList[i]=sc.next();  

}  

System.out.println("Enter the name of the contact to be searched :");  

contactName=sc.next();

System.out.println(GetPhoneNumber(contactNameList,phoneNumberList,contactName,records));  

}  

}

Explanation:

In the following the function defined above for getting the contact

number on the basis of contact number provided we are checking the contact name list if we are able to find the contact name and if we did we return the contact number on the same index from the contact number list

which we found in the contact name list.

4 0
3 years ago
Other questions:
  • Digital cameras are less susceptible to UV light.Select one of the options below as your answer:A. TrueB. False
    15·2 answers
  • You want to implement a mechanism that automates ip configuration, including ip address, subnet mask, default gateway, and dns i
    14·1 answer
  • What are two most common types of microcomputers? a. IBM-style PCs and Macs c. Clients and Servers b. Mainframes and Minicompute
    14·1 answer
  • PLEASE HELP QUICK WILL GIVE BRAINLY
    6·1 answer
  • The house belives that works should be compensated for the loss of jobs due to automation? Describe it in against motion of the
    15·1 answer
  • Select the correct answer.
    5·1 answer
  • 7) Which of the following factors determines the structure, features, and functions of an information system used in a company?
    7·1 answer
  • All NATE specialties are offered at two levels, A. journeyman and master. B. installation and service. C. apprentice and journey
    7·1 answer
  • You attempt to telnet to system 192.168.1.240. You receive the following message: "Connecting To 192.168.1.240...Could not open
    5·1 answer
  • the first thing to do when your computer gives you an error message is A restart the computer B press the F2 key C write down th
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!