C Program Structure

Previous
Next

Structure of a C program:

  • C application is a collection of header files and C source files
  • C source program is a combination of one or more functions.
  • Header file is a collection of pre-defined functions and variables.
  • Function is nothing but a set of instructions that performs a particular task.
  • Every C program at least contains one function called main().
  • Execution of a C program starts from main function only.
  • C is a case sensitive language, so that all the instructions of a program should be in small case only except some pre defined names (which were defined in upper case).
  • Functions is of two types
    • Pre-defined functions
    • User defined functions
  • The most useful functions for any kind of applications were already developed along with the language and placed in some libraries such as printf(), scanf() ……
  • As like pre-defined functions programmer can also develop their own functions according to their requirement called as user defined functions.
  • Any requirement of pre-defined function in user application just includes that library with the help of pre processer directives to work with that corresponding library function.

source.c:

void main()
{
	logic
}
void fun1()
{
	logic
}
void fun2()
{
	logic
}
....
Previous
Next

Add Comment

Courses Enquiry Form