Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

how to pick random in c

#include <stdio.h>  
#include <conio.h>  
#include <stdlib.h>     
int main()  
{  
    // declare the local variables  
    int i, num;  
    printf (" Program to get the random number from 1 to 100 
");  
    for (i = 1; i <= 10; i++)  
    {  
        num = rand() % 100 + 1; // use rand() function to get the random number  
        printf (" %d ", num);  
        getch();  
}  
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pick #random
ADD COMMENT
Topic
Name
4+8 =