Main Menu

HOME

.Net
ASP
Assembly
C
C++
Delphi
HTML
Java
JavaScript
MySQL
PC interface
Powershell
Perl
PHP
VBScript
Visual Basic
XML

US Job listings




   Misc

   Amazon

   Links

    


Srand example
 

 

 

Description

This example uses the srand( ) function to seed the random number generator , we then display some random numbers

Code

#include <stdlib.h>
#include <stdio.h>
#include <time.h>

void main()
{
int x ;
srand((unsigned)time(NULL));

for(x=0;x<=20;x++)
printf("%i\t",rand());

}

Information

teste dwith Visual C++ , LCC Win 32

 

 

 

 

Download

srand.txt


 




   Sponsors
 

   Software
500 Java Tips E-book
PHP editor
PERL editor
Beginning Java
Beginning Visual Basic
Learn VB.net
Learn VB 6
VB and databases
ASP image library
C++ builder programming
C++ fundamentals

   Source Code
A text effect(VB)
Binary to decimal etc(VB)
winoscentral.com news(PHP)
get todays date(VB.net)
hello world in java(Java)
php and java example(PHP)
Delete a file(ASP)
write to a file using the filesystemobject(ASP)

    




Copyright © 2003 by programmershelp.co.uk