Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact

Background
In this module, we study conditional statements like if and else that you use in C to have parts of your code run only if certain conditions are true, and loops such as while and for while provide the facilities through which you get parts of your code to repeat a number of times, or until a certain condition is met.
Tips and short articles on this subject
Function Prototypes in C
New C Examples - pointers, realloc, structs and more
Saying NOT in Perl, PHP, Python, Lua ...
Ruby, C, Java and more - getting out of loops
for loop - how it works (Perl, PHP, Java, C, etc)
Smart English Output - via PHP and Perl ? : operator
Breaking a loop - Ruby and other languages
Wimbledon Neck
Well House Consultants
You are on the site of Well House Consultants who provide Open Source Training Courses and business hotel accommodation. You are welcome to browse and use our resources subject to our copyright statement and to add in links from your pages to ours.
Other subject areas - resources
Java Resources
Well House Manor Resources
Perl Resources
Python Resources
PHP Resources
Object Orientation and General topics
MySQL Resources
Linux / LAMP / Tomcat Resources
Well House Consultants Resources
Extras Resources
C and C++ Resources
Ruby Resources
Tcl/Tk Resources
Web and Intranet Resources
C and C based languages module C203
Conditionals and Loops
Exercises, examples and other material relating to training module C203. This topic is presented on public courses Learning to Program in C, Learning to program in C++, Programming in C, C and C++ Programming

Learning to Program in C - Conversion to C for experienced programmers. "Programming in C" is an intensive 2 days course, during which our tutor takes ...
http://www.wellho.net/course/clfull.html  [course]
Learning to program in C++ - a conversion course for programmers in other languages This intensive course teaches the C languages, and the C++ language ...
http://www.wellho.net/course/cffull.html  [course]
C and C++ Programming - a conversion course for programmers in other languages This intensive course teaches the C languages, and the C++ language which ...
http://www.wellho.net/course/cafull.html  [course]
When you're in a loop there are occasions you want to say get me our of this loop NOW, or "I'm done with the current iteration. And those are the 'classic' ...
http://www.wellho.net/mouth/962_Brea ... uages.html  [short article]
Programming in C - Conversion to C for experienced programmers. "Programming in C" is an intensive 2 days course, during which our tutor takes you from ...
http://www.wellho.net/course/cbfull.html  [course]
When writing a program, you'll often want to repeat a block of code, counting up through a table or performing a block of code with an input value (loop ...
http://www.wellho.net/mouth/1220_for ... -etc-.html  [short article]
Every time I program in C, I marvel at how clever the language is ... yet at the same time I curse some of the devices that are used to perform certain ...
http://www.wellho.net/mouth/2002_New ... -more.html  [short article]

In this module, we study conditional statements like if and else that you use in C to have parts of your code run only if certain conditions are true, and loops such as while and for while provide the facilities through which you get parts of your code to repeat a number of times, or until a certain condition is met.

This topic is presented on public courses Learning to Program in C, Learning to program in C++, Programming in C, C and C++ Programming

Examples from our training material
cb.c   Using { and } to scope a block
demo.h   Function prototypes for err.c and otherbits.c demo
eer.c   Program that makes use of ANSI C function prototypes
ex_203.c   Exercise - throw a die until you get a 6
makefile   makefile for module C203
otherbits.c   Functions used in function prototype demo (ANSI C)
sindol.c   Singapore Teapot answer
sindy.c   Singapore teapot in C
tall.c   Temperature conversions using if
tall2.c   Temperature conversions using switch
tall3.c   Temperature conversions in a while loop
tall4.c   Temperature conversions with ++ and +=
tall6.c   Temperature conversions in a while loop
Background information
Some modules are available for download as a sample of our material or under an Open Training Notes License for free download from http://www.training-notes.co.uk.
Topics covered in this module
The if statement.
Writing conditions in C.
Exercise.
if, else, elseif.
switch, case, default.
while.
++ and += operator families.
Exercise.
do while.
for.
break and continue.
goto and labels.
Layout of your blocks, and comments revisited.
Exercise.
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule page.

Well House Consultants specialise in training courses in Python, Perl, PHP, and MySQL. We run Private Courses throughout the UK (and beyond for longer courses), and Public Courses at our training centre in Melksham, Wiltshire, England. It's surprisingly cost effective to come on our public courses - even if you live in a different country or continent to us.

We have a technical library of over 700 books on the subjects on which we teach. These books are available for reference at our training centre. Also available is the Opentalk Forum for discussion of technical questions.


You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2010: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 344596 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho