Exercises, examples and other material relating to training module C202. This topic is presented on public courses
Learning to Program in C,
Learning to program in C and C++,
Programming in C,
C and C++ Programming,
Learning to program in C and C++,
C and C++ Programming
Background
Programs store information in variables, and we'll look at
how these are declared, initialise and used for calculation in
C. We'll also look at reading inputs from the user and writing
information back out so that by the end of this module you'll have
written a simple but practical program in C.
Articles and tips on this subject | updated |
4632 | Remember to ask the question before you listen for the answer I love some of the basics ... like reminding people writing programs that they need to prompt the user to make an input at the keyboard before they read that input - otherwise they'll get people complaining that the program just hangs. In C, from today's course.
/* Tell the user that you ... | 2016-01-26 |
4337 | Learning to program sample program - past its prime, but still useful On a "Learning to Program in xxxx" day, we start off from basics and develop (first) a very simple input - calculate - output program then (second) we extend it to include conditional code and repeated code.
During the course of the day, delegates will ask "what about xxxx" and "could it do yyyy", ... | 2014-12-02 |
3590 | Defining, declaring and initialising variables in C When you declare a variable in C, you're instructing the compiler to set memory aside for it, and you're also telling the compiler how to handle any references to that memory.
• C does NOT spend time working out what sort of data you're storing and how many bytes are needed - it's up to you to ... | 2012-01-28 |
3236 | C - a first program that does something useful for you Any language has a whole number of different types of element that come together to make a whole.
Let's take a spoken language such as English. You need nouns - they're 'thing' words like "platypus" and "road", "carrot" and "Walter". Then you need verbs to join them together - they're 'doing' words ... | 2011-04-09 |
3121 | New year, new C Course Well - not completely a new course. New delegates, and lots of new examples written for them during the first day to that they can see not only WHAT work but also HOW the design of what works is put together during the day. Click on the individual source code examples, and you'll find programs to ... | 2011-01-08 |
2580 | C course inspires new teaching examples If you're reading this article as one of a series in my blog, looking for amusing anecdotes, and news of Melksham, you may be getting a bit concerned at the long series of articles on C and C++. This week, I was at meetings at Well House Manor on Tuesday evening, the divisional police HQ on Wednesday ... | 2010-06-23 |
888 | Turning C from source to a running program With scripting languages (or near-scripting languages) such as shell, Tcl, Perl, Python and PHP, the developer just edits a file of program code, and tests it - the tools that he uses roll the translation of his source into something that can be run without him having to make further inputs. C is somewhat ... | 2006-10-06 |
Examples from our training material
adder.c | Variables and arithmetic in C |
calcit.c | First calculation |
cvopt.c | Prompt - read - calculate - decide - report |
fred.c | Calculation of VAT on an amount |
makefile | makefile for module C202 |
nranges.c | Testing number ranges in C |
p003.c | Remember to prompt the user |
second.c | Read, Calculate, output results |
tconv.c | Temperature conversions |
vars.c | Delaring but not initialising - what happens? |
vars2.c | Declaring and initialising variables |
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
[here].
Topics covered in this module
Variables, types and numeric types.
Float and ints. Short long and double.
Calculations.
Basic use of printf.
Exercise.
Input from the user.
Conversion and type casting.
Multiple assignments.
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
Ruby,
Lua,
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.