View Single Post
  #6 (permalink)  
Old 05-02-2008, 03:23 AM
poornima poornima is offline
D-Web Sr.Programmer
 
Join Date: Dec 2007
Posts: 189
poornima is on a distinguished road
Smile Re: how to create random number in c?

Hi,
U can use the rand() function to generate random numbers.
Use the following coding,
#include <stdio.h>
#include <stdlib.h>
#include<math.h>
void main()
{
int i=100,c;
c=rand()%100;
printf("Random numbers between 0 and 99");
printf("%d",c);
getch();
}
Reply With Quote