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

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

2746


solve the problem in the programming language C++"if a five digit number is input through the keyboard.Write a program to calculate the sum of its digits(hint: use the modulus operator)

2935


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

2565


write a function that allocates memory for a single data type passed as a parameter.the function uses the new operator and return a pointer to the allocated memory.the function must catch and handle any exception during allocation

2405


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

4307






write a program using 2 D that searches a number and display the number of items 12 inputs values input 15,20, 13, 30, 38, 40,16, 18, 20 ,18 ,20 enter no. to search : 20

3368


Code for Easily Using Hash Table?

2391


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

2065


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

2366


create a stucture student containing field for roll no,class,year and marks.create 10 student annd store them in a file

2220


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

2407


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

2216


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

1945


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

2938


Implement a command console for changing settings on a particular object. The command console should allow you to enter a string and will return the response (very similar to a terminal session). The commands are as follows: SET propertyname=newvalue will change the target object’s member named “propertyname” to have a value equal to “newvalue”. If the input value is incompatible (i.e. an int being set to a string), print out an appropriate error message. GET propertyname will print out the current value of the target object’s member named “propertyname”. GET * will print out a list of all target object members and their current values. The system should be extensible for future commands and should accept an arbitrary object, such that another developer could insert another object into the system and rely on the command console to get and set the properties correctly.

3398