answersLogoWhite

0

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;

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

Can you write an algorithm to find the beast numbers?

maybe


Write an algorithm to check whether a number is a prime number or not?

You can write out this algorithm. This will then be programmed into the device to make determining prime numbers easier.


Write algorithm and draw flowchart to find the sum of even numbers?

jgfujtf


Write an algorithm to find the largest number in a group of three integer numbers?

The following algorithm works for any number of integers: Assume the first number is the maximum - maximum = (first number). Compare your assumed maximum with the second number. If the second number is larger than the assumed maximum, replace the old assumed maximum with the second number. Repeat for the third number, for the fourth, etc. - always copying the nth. element to the assumed maximum if you find one that is larger than your previous maximum.


Write an algorithm to print sum of all even numbers?

Start print "the sum of all even numbers is infinite" end


Write an algorithm and draw a corresponding flowchart to search a number in the given list of numbers and also display its position?

please give me an algorithm and a corresponding flow chart that displays list of numbers from 1 to 20.


How do you find minimum number amongst 100 numbers Write step by step procedure?

one method is to use MS Excel .but i am interested in the algorithm or steps involved to determine th minimum or maximum that is the science working behind it.


What is algorithm to write algorithm to the program to access a pointer variable in structure?

Here is the algorithm of the algorithm to write an algorithm to access a pointer in a variable. Algorithmically.name_of_the_structure dot name_of_the _field,eg:mystruct.pointerfield


Write an algorithm to find the root of quadratic equation?

Write an algorithm to find the root of quadratic equation


Shell program for gcd of three given numbers?

write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? check bellow link http://bashscript.blogspot.com/2009/08/gcd-of-more-than-two-numbers.html


A Write the algorithm to concatenate two given strings?

a write the algorithm to concatenate two given string


Write an algorithm that accept five numbers add them together and output the results instruct?

dont know use google instead dumb