MaximumNo4
This commit is contained in:
19
MaximumNo4.c
Normal file
19
MaximumNo4.c
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
// WAP to find out maximum out of three numbers using nested if..else.
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
int n1, n2, n3;
|
||||||
|
printf("Enter three numbers: ");
|
||||||
|
scanf("%d %d %d", &n1, &n2, &n3);
|
||||||
|
|
||||||
|
if (n1 >= n2) {
|
||||||
|
if (n1 >= n3)
|
||||||
|
printf("%d is the largest number.", n1);
|
||||||
|
else
|
||||||
|
printf("%d is the largest number.", n3);
|
||||||
|
} else {
|
||||||
|
if (n2 >= n3)
|
||||||
|
printf("%d is the largest number.", n2);
|
||||||
|
else
|
||||||
|
printf("%d is the largest number.", n3);
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
MaximumNo4.exe
Normal file
BIN
MaximumNo4.exe
Normal file
Binary file not shown.
@@ -14,4 +14,5 @@
|
|||||||
|12 | SolveExpression2.c | SolveExpression2.exe | WAP to solve given expression "ans=a + b - (c*d) / f + g" |
|
|12 | SolveExpression2.c | SolveExpression2.exe | WAP to solve given expression "ans=a + b - (c*d) / f + g" |
|
||||||
|13 | SolveExpression3.c | SolveExpression3.exe | WAP to solve given expression "ans = a / (a+b) - [ d * e / (f*g)]" |
|
|13 | SolveExpression3.c | SolveExpression3.exe | WAP to solve given expression "ans = a / (a+b) - [ d * e / (f*g)]" |
|
||||||
|14 | AgeCheck.c | AgeCheck.exe | WAP to check your age > 18 or not (using if else statement) |
|
|14 | AgeCheck.c | AgeCheck.exe | WAP to check your age > 18 or not (using if else statement) |
|
||||||
|15 | MaximumNo2.c | MaximumNo2.exe | WAP to find out maximum out of two numbers |
|
|15 | MaximumNo2.c | MaximumNo2.exe | WAP to find out maximum out of two numbers |
|
||||||
|
|16 | MaximumNo4.c | MaximumNo4.exe | WAP to find out maximum out of three numbers using nested if..else |
|
||||||
Reference in New Issue
Block a user