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

Answer Posted / dapumptu

If the inputs are a, b, and c,

max = a;
if (b > max) max = b;
if (c > max) max = c;

now max will contain the largest of the three.

Is This Answer Correct ?    17 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to take time as input in the format (12:02:13) from user so that controls remains between these columns?

1924


write a program using virtual function to find the transposing of a square matrix?

2964


A suduco given & u hv 2 check if it is incomplete(blanks left),or correct or incorrect

2520


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?

3001


output for printf("printf");

2082






Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)

3395


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; }

678


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

2474


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

2839


1+1/2!+1/3!+...+1/n!

2050


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++

663


How to swap two ASCII numbers?

2553


Code for Small C++ Class to Transform Any Static Control into a Hyperlink Control?

2658


i really need help about this.. write a program to display the set of odd and even numbers separately. find the highest and lowest value of the given numbers.

2095


write a program that prompt the user to enter his height and weight,then calculate the body mass index and show the algorithm used

4440