C program structure:-It should have main function. Its programming is modular function. It has a component of each statement and function. It is a case sensitive language i.e. all the alphabets must be written in lower case.
Approaches of language: – C language has four approaches i.e. procedural, logical, artificial intelligence and object oriented.
Program in C: – For saving a program press ALT then F then S then a dialog box will appear and save the file with .c extension. To compile a program press ALT then ‘c’ it includes all the library files in it and for running a program press ALT then R and then it starts linking a program. Compiling and running both can be done by pressing ALT+F9. After running program it creates three files i.e. source (.c), object file (.obi) and executable file (.exe).
To give output we use ‘printf()’ function which is predefined in C library. It has format specifications i.e. ‘\n’ for new line and ’\t’ for tap space. It has four type of data type i.e. int, char, float and double. Operators in C language are assingment, conditional, auto increment and decrement, relational and logical operators. It has a ‘for’ loop ‘while’ loop and a ‘do…while’ loop. It has function which contains statements to be executed and this function can be user defined. In it we have to include header file because it contain definition of some pre-defined function. Some function has the ability to call itself that are called recursive function. It has array which is collection of similar elements. It has a pointer which represents address of data element. It can also handle file by opening, closing and doing editing in it.
Stack: – It is a set of elements in which insertion and deletion of elements is done from the one end. Insertiation is called PUSHING and deletion is called POPING and it follows LIFO principle.
Download C Program Structure .