Function name : rand
Header file : <stdlib.h>
Function prototype : int rand(void);
Function : used to generate random numbers
Parameters : no parameters
Return value : Returns the generated random integer
Program example : Use this function to generate 2 random two-digit numbers
#include<stdio.h>#include<stdlib.h>intmain(void){intb,i=2;while(i--){b=rand()%90+10;printf(b%d=%d n,2-i,b);}return0;}
Running results
b1=51b2=27