fork download
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5. int value1 = 12; //declare value1
  6. int value2 = 15; //declare value2
  7. int value3 = 10; //declare value3
  8. int value4 = 5; //declare value4
  9.  
  10.  
  11.  
  12. int min4 = ((value1 < value2) && (value1 < value3) && (value1 < value4)) ? value1 : // value1 is the smallest
  13. ((value2 < value1) && (value2 < value3) && (value2 < value4)) ? value2 : // value2 is smallest
  14. ((value3 < value1) && (value3 < value2) && (value3 < value4)) ? value3 : // value3 is smallest
  15. value4; // otherwise value4 is smallest
  16.  
  17. int LowValue = min4;
  18.  
  19.  
  20. printf("The smallest int value of the 4 is : %d", LowValue);
  21.  
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 5292KB
stdin
Standard input is empty
stdout
The smallest int value of the 4 is : 5