fork(1) download
  1. #include <stdio.h>
  2. #include <float.h>
  3.  
  4. int main(){
  5. int count;
  6. double input;
  7. double output = DBL_MAX;
  8. int i;
  9.  
  10. printf("Enter a positive integer: ");
  11. scanf("%i", &count);
  12. for (i = 0; i < count; i++){
  13. printf("Enter a number:");
  14. scanf("%lf", &input);
  15.  
  16. if(output>input)
  17. {
  18. (output = input);
  19. }
  20.  
  21. }
  22. printf("The smallest number is: %f", output);
  23. }
Success #stdin #stdout 0s 3144KB
stdin
1
3
stdout
Enter a positive integer: Enter a number:The smallest number is: 3.000000