Ask Question
17 July, 01:49

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

+4
Answers (1)
  1. 17 July, 03:35
    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 myints;

    myints. push_back (a);

    myints. push_back (b);

    myints. push_back (c);

    sort (myints. begin (), myints. end ());

    cout << myints. back ();

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write a programme with C + + language wich print the biggest number in between three numbers, whith INT ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers