C   15

decisionTree 2 lines

Guest on 1st June 2022 01:18:06 AM

  1. #include <stdio.h>
  2. int main(){int n1, n2, n3;printf("sort 3 numbers in ascending order\n");printf("input numbers = ");scanf("%d%d%d",&n1,&n2,&n3);printf("numbers in ascending order = "); if (n2 > n1) if (n3 > n2)  printf("%d %d %d\n",n1,n2,n3);else if (n3 > n1)printf("%d %d %d\n",n1,n3,n2);else printf("%d %d %d\n",n3,n1,n2);else if (n3 > n2) if (n3 >  n1)printf("%d %d %d\n",n2,n1,n3);else printf("%d %d %d\n",n2,n3,n1);else printf("%d %d %d\n",n3,n2,n1);return 0;}

Raw Paste


Login or Register to edit or fork this paste. It's free.