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];
largest of a, b, c :a > b ? a > c ? a : c : b > c ? b : c
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
To find the largest of three numbers, first find the largest of two numbers: int max (int x, int y) { return x<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); }
R = (A > B && A > C) ? A : (B > C) ? B : C; // parentheses not necessary - for clarity only
6 + 8 + 10 = 24Therefore the largest of the three numbers will be 10.
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
Step1- Read a,b,c. Step2-if a>b continue step 5. Step3- b>c then print “b is the largest " and continue step 7. Step4- continue step 6 Step5-if a>c then print “a is the largest " then continue step7. Step6- print “z is largest". Step7- end.
yes
start input A & B if A>B print A is greatest if B>A print B is greatest stop james ola writes.....SOT.
max = a > b ? a : b; max = max > c ? max : c;
94+95+96 96
998