Here is an example in Java: int a = 5; int b = 7; System.out.println(a > b ? a : b);
Here is an example in Java: int a = 5; int b = 7; System.out.println(a > b ? a : b);
Here is an example in Java: int a = 5; int b = 7; System.out.println(a > b ? a : b);
Here is an example in Java: int a = 5; int b = 7; System.out.println(a > b ? a : b);
Chat with our AI personalities
#include<stdio.h>
int main(){
int a,b,c;
int big;
printf("Enter any there numbers: ");
scanf("%d%d%d",&a,&b,&c);
if(a>b && a>c)
big = a;
else if(b>c)
big = b;
else
big = c;
printf("Largest number is: %d",big);
return 0;
}
Here is an example in Java: int a = 5; int b = 7; System.out.println(a > b ? a : b);
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.
draw a flowchart to find the biggest number among the 3 numbers
#include<stdio.h> void main() { int a=10,b=15; clrscr(); if(a>b) printf("%d is the large number",a); else printf("%d is the large number",b); getch(); }
The sizeof() operator returns the number of bytes allocated to the operand.
To test if two number are equal in JavaScript, we use the == operator and compare them. The below function test if two number (a and b) are equal. The function returns 1 if a is greater, -1 if b is greater, and 0 if the numbers are of equal value. function isEqualTo( a, b ){ if ( a > b ){ return 1; } if (b > a ){ return -1; } return 0; }