how to find out the maximum number out of the three inputs.

Answer Posted / ceeemor

#include<iostream>
using namespace std;
int main() {

int num[3];

cout << " Input 3 integers : ";
for (int i =0; i <3; i++) {
cin >> num[i];
}

sort(num, num+3);

cout << " The largest num in the given input s : " << num
[2] << endl;

return 0;
}

Is This Answer Correct ?    14 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

output for printf("printf");

1985


U hv to enter a range from a and b and search hw many no. of times a pattern n. occurs between the range a and b. Eg :i/p:enter range :0 100 Enter pattern: 13 o/p: the no. times 13 occurred betwwn 0 to 100:1 Eg :i/p:enter range :100 1000 Enter pattern: 13 o/p: the no. times 13 occurred betwwn 100 to 1000: (in this 13,113,131,132,133…139,213,313,…913 all these will be counted)

2125


write a program to calculate the amount of investment after a period n years if the principal investors was p and interest is calculated using compound interest,formular=a=p(1+r)^n

2367


can you please write a program for deadlock that can detect deadlock and to prevent deadlock.

2746


Write a program that print in screen a tree with its height taken from user by entering number of 4 digits and find the odd numbers then calculate the sum of odd numbers so he get the height of tree?

2915






Teta-Omeg-Big-Oh Show that f(n) = n2 + 3n3 is ;(n3).

3193


write a program that reverses the input number of n.Formulate an equation to come up with the answer.

7038


write a function that reverse the elements of an array in place.The function must accept only one pointer value and return void.

3957


develop a program to calculate and print body mass index for 200 employees

2216


Code for Easily Using Hash Table?

2391


Question 1: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date. *This Should Be Done IN C++

552


how to diplay a external image of output on winxp by using c & c++,

2938


Ask the user to input three positive integers M, N and q. Make the 2 dimensional array of integers with size MxN, where all the elements of I (I = 1,…,M) line will be members of geometrical progression with first element equal to the number of line (I) and denominator q.

3396


Write a simple encryption program using string function which apply the substitution method.

5538


What output does this program generate as shown? Why? class A { A() { cout << "A::A()" << endl; } ~A() { cout << "A::~A()" << endl; throw "A::exception"; } }; class B { B() { cout << "B::B()" << endl; throw "B::exception"; } ~B() { cout << "B::~B()"; } }; int main(int, char**) { try { cout << "Entering try...catch block" << endl; A objectA; B objectB; cout << "Exiting try...catch block" << endl; } catch (char* ex) { cout << ex << endl; } return 0; }

580