Introduction to "C" programming:
1.Denis ritchie was developed "c' language at bell laboratories in 1972.
2.As 'c' language is developed along with "Unix" operating system, it is strongly associated with unix.
3. The unix was also developed at bell laboratories and it was coded almost entirely in "c" language.
Importance of "c"
1. "C" is highly portable. This means that "c" program written for one computer can be run on another with no modification on a computer with a different operating system.
2. programs written in 'C" are efficient and fast.
3. It is robust language with rich set of built in functions and operators, which can be used to write any complex program.
4. "C" language is well suited for structured programming.
5. Another important feature of "C" is its ability to extend itself. we can continuously add our own functions to the "C" library. With the availability of a large number of functions the programming tasks becomes simple.
simple "C" program:
#include <stdio.h>
main( )
{
printf("This is my first programn");
printf("This is my second line");
}
1. main() : name of the program and the execution begins at this line.
The main () is a special function used by the 'C" to tell the computer where the program starts.
2. Every program must have one main() function.
3. () the empty pair of parenthesis indicates that the function main has no arguments .
4. { indicates the beginning of function main.
5. } indicates as closing of function main.
6. all statements between two brackets form the function body.
the function body contains the a set of instructions to perform the given task.
7. The"printf" is predefined "c" function for printing output. Predefined means that it is a function that has already been written and compiled and linked together with our program at the time of linking.
8. Each statement end's with a semicolon indicates end of statement.
9. n is called new line character. new line character instructs the computer to go the next line.