answersLogoWhite

0


Best Answer

max = a > b ? a : b;

max = max > c ? max : c;

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: C program to find the largest among three numbers using ternary operator?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How can you download c compiler?

write a c program to fine largest/smallest of 3no (using ?:ternary operator/conditional operator)


How do you find the greatest of three numbers using ternery operator?

Compare the first two numbers with the ternary operator. Store the result in a temporary variable. Compare the temporary variable with the third number, again using the ternary operator.


Write a c plus plus program to find the largest among three numbers using ternary operators?

R = (A > B && A > C) ? A : (B > C) ? B : C; // parentheses not necessary - for clarity only


What is condional operator?

Conditional Operator- Its the only ternary operator in c/c++.- Its syntax is-(condition)?statement1:statement2;-Shruti Jain


What is the name of the expression that is formed by using logical operators?

Ternary operator


How do you write a algorithm for finding maximum of 2 numbers in c?

You can use the ternary operator, in an expression such as: result = a > b ? a : b; This is equivalent to: if (a > b) result = a; else result = b;


Write a programme to find greater among two numbers in c plus plus?

You could use an if, but the ternary operator is especially compact for this purpose: result = a > b ? a : b;


What is the conditional operators in c language?

The conditional operator is also known as ternary operator. It is called ternary operator because it takes three arguments. The conditional operator evaluates an expression returning a value if that expression is true and different one if the expression is evaluated as false.Syntax:condition ? result1 : result2If the condition is true, result1 is returned else result2 is returned.


Which c plus plus operators cannot be overloaded?

1. Member-of operator (.) 2. Pointer-to-member-of operator (.*) 3. Ternary condition operator (?:) 4. Scope resolution operator (::) 5. sizeof operator 6. typeid operator


What is the algorithm for determining the maximum of two numbers?

Compare two numbers, a and b. If a is greater than b then return a, otherwise return b. In C, we can implement this algorithm using the ternary operator (?:), as follows: return a>b?a:b;


What are special operators in c plus plus?

The only "special" operators in C++ are those that cannot be overloaded. That is; the dot member operator (.), pointer to member operator (.*), ternary conditional operator (:?), scope resolution operator (::), sizeof() and typeof().


What are the numbers that are used in the ternary system?

0 1 and 2