Created
July 28, 2018 08:54
-
-
Save simplyniceweb/d527d882bd0029c1ccd9564a02ee8dab to your computer and use it in GitHub Desktop.
kiking do you love me
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int n[3]; | |
int a, max, min1, min2, index, num1, num2, num3; | |
printf("enter three numbers:\n"); | |
scanf("%d%d%d", &num1, &num2, &num3); | |
n[0] = num1; | |
n[1] = num2; | |
n[2] = num3; | |
for( a = 0; a < 3; a = a + 1 ){ | |
if (n[a] > max) { | |
index = a; | |
max = n[a]; | |
} else { | |
if (!min1) { | |
min1 = a; | |
} else { | |
min2 = a; | |
} | |
} | |
} | |
if (n[0] == n[1] && n[0] == n[2]) { | |
printf("All 3 numbers are equal."); | |
} else { | |
printf("%d is greater than %d and %d", n[index], n[min1], n[min2]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment