Skip to content

Instantly share code, notes, and snippets.

@simplyniceweb
Created July 28, 2018 08:54
Show Gist options
  • Save simplyniceweb/d527d882bd0029c1ccd9564a02ee8dab to your computer and use it in GitHub Desktop.
Save simplyniceweb/d527d882bd0029c1ccd9564a02ee8dab to your computer and use it in GitHub Desktop.
kiking do you love me
#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