Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- #include <time.h>
- double drand(void) {
- double ret = (double)rand() / ((double)rand() + 0.1);
- return ret - floor(ret);
- }
- int main(void){
- int i = 5;
- srand(time(NULL));
- while ( i-- ){
- int n=rand()% 200-100;
- float numb=n+drand();
- printf("%f\n", numb);
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement