Main Menu

HOME

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

Sedo - Buy and Sell Domain Names and Websites project info: programmershelp.co.uk Statistics for project programmershelp.co.uk etracker® web controlling instead of log file analysis

   Misc

   Amazon

   Links

    


Numbers in a range
 

 

Description

This example shows how to generate random numbers in a range , in this case between 20 numbers between 1 and 10.

Code

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

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

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

}

Information

tested on Visual C++ 6

 

 

 

 

 

Download

randomrange.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
Display all environment variables(Powershell)
Display an Access database(PHP)
split text up into different rows and insert into an html table(php)
activate the windows screensaver(Visual Basic)
scroll title bar caption(VB)
mysql version(php)
list printers(VB)
Move a folder with MoveTo(C Sharp)

    




Copyright © 2003 by programmershelp.co.uk