MaximumNo2
This commit is contained in:
22
MaximumNo2.c
Normal file
22
MaximumNo2.c
Normal file
@@ -0,0 +1,22 @@
|
||||
// WAP to find out maximum out of two numbers.
|
||||
|
||||
void main() {
|
||||
int num1, num2;
|
||||
printf("Enter two numbers: ");
|
||||
scanf("%d%d", &num1, &num2);
|
||||
|
||||
if(num1 > num2) {
|
||||
printf("%d is maximum", num1);
|
||||
}
|
||||
|
||||
else if(num2 > num1) {
|
||||
printf("%d is maximum", num2);
|
||||
}
|
||||
|
||||
else if(num1 == num2) {
|
||||
printf("Both are equal");
|
||||
}
|
||||
else {
|
||||
printf("Error: Invalid Input");
|
||||
}
|
||||
}
|
||||
BIN
MaximumNo2.exe
Normal file
BIN
MaximumNo2.exe
Normal file
Binary file not shown.
@@ -14,3 +14,4 @@
|
||||
|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)]" |
|
||||
|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 |
|
||||
Reference in New Issue
Block a user