BASIC SYNTAX OF C

BASIC SYNTAX  of C  is a set of rules, principles, and processes that govern the structure of C programming language.

Before getting started with the C Programming language it’s very crucial to understand the basic syntax of C 

//Example of C program
#include<stdio.h>
int main(void)
{
printf("Hello World!");
return 0;
}
  • #include is a preprocessor command.  # hash symbol in c language are processed by preprocessor.
  • stdio.h  .h file in the above program imports some external libraries/functions which required in our program .file contains functions such as scanf() and print().
  • int main(void) The main function indicates the compiler to tell from where to start the program execution.
  • printf() is a library function to print formatted output to the screen
  • return 0 statement is the “Exit status” of the program
  • ;  semicolon is the terminator it is placed after every single line of code.

Comments in C Programming language

/* */ Single line comment 

Example  /*This is an example of single line comment*/

Comments are not read by the compiler it is used by the compiler to keep the track of the flow of the program written by him/her.

// Multiline Comment : 

Example  //This is an example of multi-line comment.

BUY NOW AT AMAZON

 

Leave a Reply

Your email address will not be published. Required fields are marked *