Sunday, 23 February 2014

Ramdom number generator

Ramdom number generator
how to gnerator ramdom number in c
printf("this code woke only turbo c++");
#include<stdio.h>
int main()
{
    int n,max,num,c;
    printf("Enter the number of random number you want");
    scanf("%d",&n);
    printf("Enter the maxmum value of random number\n");
    scanf("%d",&max);
    printf("Randem numer from  0 to %d are \n",n,max);
    randomize();
    for(c=1;c<=n;c++)
    {
        num=random(max);
        printf("%d\n",num);

    }
}

No comments:

Post a Comment