answersLogoWhite

0

This is best done with an array; that way, you can easily extend to more than three numbers. In Java, it would be something like this:

int myNumbers[] = {1, 5, 3};

int max = myNumbers[1];

for (int i = 1; i < myNumbers.length(); i++)
if (myNumbers[i] > max) max = myNumbers[i];



This is best done with an array; that way, you can easily extend to more than three numbers. In Java, it would be something like this:

int myNumbers[] = {1, 5, 3};

int max = myNumbers[1];

for (int i = 1; i < myNumbers.length(); i++)
if (myNumbers[i] > max) max = myNumbers[i];



This is best done with an array; that way, you can easily extend to more than three numbers. In Java, it would be something like this:

int myNumbers[] = {1, 5, 3};

int max = myNumbers[1];

for (int i = 1; i < myNumbers.length(); i++)
if (myNumbers[i] > max) max = myNumbers[i];



This is best done with an array; that way, you can easily extend to more than three numbers. In Java, it would be something like this:

int myNumbers[] = {1, 5, 3};

int max = myNumbers[1];

for (int i = 1; i < myNumbers.length(); i++)
if (myNumbers[i] > max) max = myNumbers[i];

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Write a 'c' program to fine a largest of three numbers?

largest of a, b, c :a > b ? a > c ? a : c : b > c ? b : c


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


Write a C plus plus program and flow chart to find the largest of the 3 numbers?

To find the largest of three numbers, first find the largest of two numbers: int max (int x, int y) { return x&lt;y?y:x; } Now you can use this one function to find the largest of three numbers: int max (int x, int y, int z) { return max (max (x, y), z); }


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

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


The sum of three consecutive even numbers is 24 What is the largest of these numbers?

6 + 8 + 10 = 24Therefore the largest of the three numbers will be 10.


Write a shell program to find largest of three numbers?

echo Enter 3 numbers with spaces in between read a b c l=$a if [ $b -gt $l ] then l=$b fi if [ $c -gt $l ] then l=$c fi echo Lagest of $a $b $c is $l


Write an algorithm to find the largest number amongst three numbers and draw a flowchart?

Step1- Read a,b,c. Step2-if a&gt;b continue step 5. Step3- b&gt;c then print “b is the largest &quot; and continue step 7. Step4- continue step 6 Step5-if a&gt;c then print “a is the largest &quot; then continue step7. Step6- print “z is largest&quot;. Step7- end.


On the page you should have three pieces of input, h1 element and one button. The user writes numbers in the inputs, after pressing the button, in h1 you must write which of these numbers is the largest?

yes


Draw a flowchart that will determine and display the largest among the three numbers being inputted?

start input A &amp; B if A&gt;B print A is greatest if B&gt;A print B is greatest stop james ola writes.....SOT.


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

max = a &gt; b ? a : b; max = max &gt; c ? max : c;


The sum of three consecutive numbers is 285 The largest of these three numbers is what?

94+95+96 96


What is the largest three-digit even numbers?

998