Main Menu

HOME

.Net
ASP
Assembly
C
C++
Delphi
HTML
Java
JavaScript Site
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
Page last accessed(PHP)
Split a string(ASP)
Log on as different user(VB)
delete a directory with Delete(C Sharp)
Changing the case of a string(VB.net)
Check if network is available(VBnet)
change text in a string(php)
Get the connection time with PHP and cURL(PHP)

    




Copyright © 2003 by programmershelp.co.uk