+1 vote
in Technology by (1.8m points)

What is the process to generate random numbers in C programming language?

1 Answer

0 votes
by (1.8m points)

The command rand() is available to use for this purpose. The function returns an integer number beginning from zero(0). The following sample code demonstrates the use of rand().


#include <stdio.h>
#include <stdlib.h>
int main ()
<div class="line number5 index4 alt2" style="border: 0px !important; margin: 0px !important; padding: 0px 1em 0px 0em !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; position: static !important; righ