Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Sunday assignment v2
//gcc 5.4.0 #include <stdio.h> int main(void) { int numOne; int numTwo; int numThree; int i; scanf("%d%d%d", &numOne, &numTwo, &numThree); printf("%d \n%d \n%d\n", numOne, numTwo, numThree); int num[3]; num[0]=numOne; num[1]=numTwo; num[2]=numThree; int max=numOne; int min=numOne; for (i=0; i<3; i++) { if (num[i]>max) { max=num[i]; } } printf("The maximum number is %d\n", max); for (i=0; i<3; i++) { if (num[i]<min) { min=num[i]; } } for(i=0; i<3; i++){ if (num[i]==0) { printf("%d is equal to 0\n", num[i]); } else { printf("%d is not equal to zero\n", num[i]); } } for(i=0; i<3; i++) { if (num[i]>0) { printf("%d is a positive number\n", num[i]); } } for(i=0; i<3; i++) { if (num[i]<0) { printf("%d is a negative number\n", num[i]); } } for(i=0; i<3; i++) { if (num[i]%2==0) { printf("%d is even\n", num[i]); } else { printf("%d is odd\n", num[i]); } } if ((num[0]==num[1]) && (num[1]==num[2])) { printf("All three numbers are the same"); } else if (num[0]==num[1]) { printf("%d is equal to %d", num[0], num[1]); } else if (num[0]==num[2]) { printf("%d is equal to %d", num[0], num[2]); } else if (num[1]==num[0]) { printf("%d is equal to %d", num[1], num[0]); } else if (num[1]==num[2]) { printf("%d is equal to %d", num[1], num[2]); } else if (num[2]==num[0]) { printf("%d is equal to %d", num[2], num[0]); } else if (num[2]==num[1]) { printf("%d is equal to %d", num[2], num[1]); } return 0; }
run
|
edit
|
history
|
help
0
a1
150109_RecursividadFactorial
150115_MatrizTodosDistintos
app1
150108_RecursivoPrimo
swipe the numbers in cyclic way
selection sort
TruncatablePrime
edmond@DESKTOP-M2BC2LH
ECE 2574 1/23