// assume you want the find the largest of ints a,b,c:
int max = (a>b&&a>c?a:b>c?b:c);
largest = first > second ? (first > third ? first : third): (second > third ? second : third);
In C or C++:
int max( int x, int y ) { return( x>y?x:y ); }
printf ("Biggest: %d\n", N>M ? N : M);
operands are the objects or variable that we create in our program. operators fuse with the operands to build a mathematical statement in the program.
Not possible. Let's not forget than in C the followings are all operators:+, -+=, -=++, --=&, *, []function-call
int i, largest=0;do { scanf ("Enter a number (0 to exit): %d", i); if (i>largest) largest=i; } while (i!=0); printf ("Largest number is: %d\n", largest);
start input A & B if A>B print A is greatest if B>A print B is greatest stop james ola writes.....SOT.
Use the following algorithm (written in pseudocode). Let largest be the lowest possible real number. Let smallest be the greatest possible real number. Repeat while there is input... { Read real number r from input. If r is greater than largest then let largest be r. If r is less than smallest then let smallest be r. } End repeat. Let range be largest minus smallest. Output range.
R = (A > B && A > C) ? A : (B > C) ? B : C; // parentheses not necessary - for clarity only
program to find maximum of two numbers using pointers
operands are the objects or variable that we create in our program. operators fuse with the operands to build a mathematical statement in the program.
TurboC is a program, the language is C Some of the operators are: . -> * [] () , ?: = == < <= > >= != + += ++ - -= -- % %= / /= << <<= >> >>= ! ~ ^ & &= && | |=
VBnet program to find the prime numbers between 100 to 200?
Not possible. Let's not forget than in C the followings are all operators:+, -+=, -=++, --=&, *, []function-call
largest of a, b, c :a > b ? a > c ? a : c : b > c ? b : c
first sort the ten numbers in descending order and print the first number. That will be the largest no
You can use int i; for (i = 10; i <= 50; i += 2) {//print i} as a program to print even numbers between 10 and 50.
int i, largest=0;do { scanf ("Enter a number (0 to exit): %d", i); if (i>largest) largest=i; } while (i!=0); printf ("Largest number is: %d\n", largest);
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); }
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