Main Menu

HOME

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

Make money selling software. Check this out here

Hosted clickbank mall. Check this out here




   Misc

   Amazon

   Links

    


While loop
 

 

 

Description

An example of using a while loop

Code

/*while example*/

#include<stdio.h>

int main(void)
{

const int SECRET_CODE = 15;
int code;

printf("Type the secret number to enter.\n");
scanf("%d", &code);

while(code != SECRET_CODE)
{
printf("Type the secret number to enter.\n");
scanf("%d", &code);
}
printf("Well done , you can now enter.\n");

return 0;
}

Information

tested using Visual C++ 6 , LCC Win 32

 

 

 

 

Download

while1.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
list disk drive information in an excel spreadsheet(VBScript)
Run a screensaver(VB)
Status bar text(Javascript)
download a web page to a file(PHP)
redirection function(Javascript)
List all files(ASP)
analog clock(VB)
a first applet(Java)

    




Copyright © 2003 by programmershelp.co.uk