answersLogoWhite

0

// largest = largest of a, b, c

public class largest

{

public static void main(String args[])

{

int a,b,c,largest;

a=0;

b=0;

c=0;

a=Integer.parseInt(args[0]);

b=Integer.parseInt(args[1]);

c=Integer.parseInt(args[2]);

largest=a>b?(a>c?a:c):(b>c?b:c);

System.out.println("The largest no. of "+a+","+b+"and"+c+"is"+largest);

}

}

User Avatar

Wiki User

12y ago

What else can I help you with?

Continue Learning about Engineering

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.


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 operator is called ternary operator?

A ternary operator is an operator that requires three operands, as opposed to a binary operator that requires two operands and a unary operator that requires just one operand. C++ has just one ternary operator, the conditional ternary operator: <boolean expression> ? <expression #1> : <expression #2>; If the boolean expression evaluates true, the first expression is evaluated, otherwise the second expression is evaluated. A typical usage of this operator is to return the larger (or smaller) of two values of type T: template<typename T> T max (T a, T b) {return a<b ? b : a}; template<typename T> T min (T a, T b) {return a<b ? a : b}; These are really nothing more than notational shorthand for the following: template<typename T> T max (T a, T b) {if (a<b) return b; else return a; }; template<typename T> T min (T a, T b) {if (a<b) return a; else return b;}; However, because ternary expressions are evaluated, the return value of the expression can be used in more complex expressions: int a=42, b=0; // ... int c = ((a>b ? a : b) = 1); In the above expression, whichever is the larger of a and b will be assigned the value 1 which will also be assigned to c. Thus a and c become 1 while b remains 0.


What is conditional expression operator?

The conditional operator (? :) is a ternary operator (it takes three operands). The conditional operator works as follows:The first operand is implicitly converted to bool. It is evaluated and all side effects are completed before continuing.If the first operand evaluates to true (1), the second operand is evaluated.If the first operand evaluates to false (0), the third operand is evaluated.The result of the conditional operator is the result of whichever operand is evaluated - the second or the third. Only one of the last two operands is evaluated in a conditional expression.


Draw a flow chart to find out the greatest number among the three given numbers ab c?

draw a flowchart to find the biggest number among the 3 numbers

Related Questions

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.


C program to find the largest among three numbers using ternary operator?

max = a > b ? a : b; max = max > c ? max : c;


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.


What does ternary ionic compound mean?

"Ternary" means that the compound contains three elements.


Enumerate the IUPAC rules in naming ternary compounds?

ternary compuonds are composed of three elements


What is a ternary base?

A ternary base is a numeral system with a base of three. It uses three symbols (0, 1, and 2) to represent numbers, similar to how binary (base 2) uses two symbols (0 and 1) and decimal (base 10) uses ten symbols (0-9). Ternary base can be used in computing and mathematics for various applications.


How to make decision making statements in c plus plus?

Decision making statements make use of conditional expressions. In C++ there are three possibilities: if/else, switch/case and the ternary operator (?:).


Which operator is called ternary operator?

A ternary operator is an operator that requires three operands, as opposed to a binary operator that requires two operands and a unary operator that requires just one operand. C++ has just one ternary operator, the conditional ternary operator: <boolean expression> ? <expression #1> : <expression #2>; If the boolean expression evaluates true, the first expression is evaluated, otherwise the second expression is evaluated. A typical usage of this operator is to return the larger (or smaller) of two values of type T: template<typename T> T max (T a, T b) {return a<b ? b : a}; template<typename T> T min (T a, T b) {return a<b ? a : b}; These are really nothing more than notational shorthand for the following: template<typename T> T max (T a, T b) {if (a<b) return b; else return a; }; template<typename T> T min (T a, T b) {if (a<b) return a; else return b;}; However, because ternary expressions are evaluated, the return value of the expression can be used in more complex expressions: int a=42, b=0; // ... int c = ((a>b ? a : b) = 1); In the above expression, whichever is the larger of a and b will be assigned the value 1 which will also be assigned to c. Thus a and c become 1 while b remains 0.


What is 17.81 0.45 5.73?

Three numbers, not related to one another by any mathematical operator.


Where can someone find out the definition of ternary?

The definition of ternary can be found at websites, such as The Free Dictionary, Merriam-Webster and Oxford Dictionaries. Ternary is a term that is used to describe the groups consisting of three members or components.


What is the difference between rondo and ternary?

Ternary is a object consisting of three items. A rondo is a more specific term; it is a work or movement in music that is stated at least three times in the same key.


What is 1 and 6 and 11?

That's a list of three numbers. If you actually mean 'and' like in the Boolean operator and you write the numbers as binaries, then the result is zero.