24-01-2012, 04:27 PM
programming language in c
[attachment=16543]
A Tutorial Introduction
Let us begin with a quick introduction in C. Our aim is to show the essential elements of the
language in real programs, but without getting bogged down in details, rules, and exceptions.
At this point, we are not trying to be complete or even precise (save that the examples are
meant to be correct). We want to get you as quickly as possible to the point where you can
write useful programs, and to do that we have to concentrate on the basics: variables and
constants, arithmetic, control flow, functions, and the rudiments of input and output. We are
intentionally leaving out of this chapter features of C that are important for writing bigger
programs. These include pointers, structures, most of C's rich set of operators, several controlflow
statements, and the standard library.
Getting Started
The only way to learn a new programming language is by writing programs in it. The first
program to write is the same for all languages:
The for statement
There are plenty of different ways to write a program for a particular task. Let's try a variation
on the temperature converter.