C programming Structure

C PROGRAMMING

INTRODUCTION TO THE C PROGRAMMING:

                                C programming is a general-purpose, procedural, imperative computer programming language. It was initially developed by Dennis Ritchie at the Bell Telephone Laboratories as a system programming language to write operating system. 

DENNIS RITCHIE

Before we study the basic building blocks of the C programming language, let us look at a bare minimum C program structure so that we can take it as a reference.

A C program basically consists of the following parts −

  • Preprocessor Commands
  • Functions
  • Variables
  • Statements & Expressions
  • Comments
  Consider the above as structure of C - Programming,
  • #include is a preprocessor command which includes all the methods of the header file stdio.h , .h is the extension for header file.
  •  a,b are global variables whose scope is allover the program.
  •  void is a return type of a function, the name itself says void which means it returns      nothing.
  • main() it is the starting point of a program.
  • demoStructure() is a function which is called in the main() and its body written below the main().
  • printf(),scanf() etc are built in functions or methods of stdio.h header file.
  • printf() is an output statement ,which displays the output to the user whereas scanf() is an input statement ,it is used to get  the  values or input from the user.
  • // ,it is a single line comment which is ignored by compiler.


 Thank you.

Note: If there is any mistake in this please correct me as its my very first blog!

Comments