Horje
random float number in C Code Example
c get random float
//random float between 0 and a
float x = (float)rand()/(float)(RAND_MAX/a);
random float number in C
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main()
{
    srand(time(NULL));

    float max = 1.5;
  	//algorithm for creating a random number 
  				//(float cast) (float cast)	(RAND_MAX) is a costant included in the lib time.h
    printf("%f\n", ((float)rand()/(float)(RAND_MAX)) * max);
    return 0;
}




C

Related
siteorigin shortcodes Code Example siteorigin shortcodes Code Example
online code runner .c Code Example online code runner .c Code Example
gdebi install with yes option Code Example gdebi install with yes option Code Example
write a c program to find out ncr factor of given number Code Example write a c program to find out ncr factor of given number Code Example
ringing a bell using c Code Example ringing a bell using c Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8