Tuesday 14 January 2014

Filled Under:

C programming

C programming was  developed by Dennis Ritchie at bell laboartories  USA in 1972. C is used to prepare system software and application.
lets start with C basic knowledge.......Any instruction that starts with # (pre-processor operator) take up a whole line,and finish at the end of line which line is called pre-processor directive. Files ending with .h are what known as header files, provided with each compiler and cover a range of area such as string handling,mathematical conversions,printing and reading of variables etc. Stdio.h means "standard in/out" which means standard in/out which means standard way of getting data to and form input and output devices. In our case we whish to take in data from keyboard (a standard input devices) and put data on to the screen or console (a standard output device.)Conio.h means console in/out which means way of getting data to and from the console device(which uses the keyboard and screen)> Here stdio.h is more generalized and can be used to read/write data from to a disk file permanent storage of data, write data out out to a printing device ,and so on. The conio.h library just contains the deal specially with the console (keyword and black pop-up screen). Printf, scanf etc functions are defined in stdio.h header file whereas getcg(),clrscr() functions are defined in conio.h header file.
Another use of pre-processor operator is to define the variable globally like #define pi 3.14This global variable defination always comes before main function where a variable PI is assigned by value of 3.14
Any C program alwas starts with at most one main() function.void main(){ statements;}Here,void is return type of the function definition which returns nothing. `{` indicates the starts of main function and `}`indicates the end of main function.

0 comments:

Post a Comment