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

    


Random quote
 

 

 

Description

This example gets a random number in a range then depending on the number chosen a saying is displayed.

Code

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

void main()
{
int randno;

srand((unsigned)time(NULL));
randno = rand() % 3 + 1;

switch(randno)
{
case 1 :
printf("There will come a day when all the work is finished or when it is too late to finish it\n");
break;
case 2 :
printf("You get nothing for free \n");
break;
case 3 :
printf("The world goes to shit when I dont do this first \n");
break;
case 4 :
printf("You get nothing for free \n");
break;
default :
printf("Ill be amazed if this displays\n");
break;

}

}

Information

tested in Visual C++ 6

 

 

 

 

Download

randquote.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
Browser info(ASP.net)
Sending an e-mail attachment(ASP)
random lines(VB)
writing on the desktop(VB)
displays My Pictures items(VBScript)
Delete a file(ASP)
Check if an image exists(PHP)
Get your IP address(VBNet)

    




Copyright © 2003 by programmershelp.co.uk