fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. int main() {
  6. srand(time(NULL)); // seed the random number generator with the current time
  7. float frequency = ((float)rand() / RAND_MAX) * 999.999; // generate a random float between 0 and 1, then scale it to the desired range
  8. printf("Random radio frequency: %.3f\n", frequency);
  9. return 0;
  10. }
Success #stdin #stdout 0s 5408KB
stdin
Standard input is empty
stdout
Random radio frequency: 282.129