MaximumNo4

This commit is contained in:
2021-04-27 09:31:13 +05:30
parent b64a909782
commit b1073218fa
3 changed files with 21 additions and 1 deletions

19
MaximumNo4.c Normal file
View 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);
}
}