how to find out the maximum number out of the three inputs.
Answer Posted / pavan mustyala
//Single statement code using ternary operator
int max(int a, int b, int c)
{
return (((a > b) ? a : b) > c) ? ((a > b) ? a : b) : c;
}
| Is This Answer Correct ? | 14 Yes | 8 No |
Post New Answer View All Answers
how to write a program that opens a file and display in reverse order?
i don't know about working of nested for loop can any one help me
write a program to convert temperature from fa height into celcius and vise versa,use modular programming
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!!!)
Write a C/C++ program that connects to a MySQL server and displays the global TIMEZONE.
Write a simple encryption program using string function which apply the substitution method.
Write a (n) algorithm that sorts n distinct integers, ranging in size between 1 and kn inclusive, where k is a constant positive integer. (Hint: Use a kn-element array.)
How to Split Strings with Regex in Managed C++ Applications?
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
Given a table of the form: Product Sold on A 1/1/1980 B 1/1/1980 C 1/1/1980 A 1/1/1980 B 1/1/1980 C 2/1/1980 A 2/1/1980 There are 30 products and 10,000 records of such type. Also the month period during which sales happened is given to u. Write the program to display the result as: Product Month No. of copies A January 12 A February 15 A March 27 B January 54 B February 15 B March 10 C January 37
write a program that reads a series of strings and prints only those strings begging with letter "b"
write a program that creates a sequenced array of numbers starting with 1 and alternately add 1 and then 2 to create the text number in the series , as shown below. 1,33,4,6,7,9,............147,148,150 Then , using a binary search , searches the array 100 times using randomly generated targets in the range of 1 to 150
How to swap two ASCII numbers?
Code for Method of Handling Factorials of Any Size?
can you please write a program for deadlock that can detect deadlock and to prevent deadlock.