BASIC SYNTAX OF C

In this tutorial, we are going to learn the “Basic Syntax of C” with an example of code.

What is the Basic Syntax of C  Programming Language?

Basic Syntax of C  Programming language is a set of rules, principles, and processes that govern the structure of C programming language.

An Example of C Program:

#include<stdio.h>
int main(void)
{
printf("Hello World!");
return 0;
}

Now let’s understand the basic structure of C Programming Language in detail:

Define #include in C Programming Language?

In C Programming Langauge #include is a preprocessor command. The Symbol # (hash) in C is processed by the preprocessor.

What is the function of stdio.h in C Programming Language?

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().

What the main function in C stands for?

The main function indicates the compiler to tell from where to start the program execution.

Specify the functionality of printf?

printf() is a library function to print formatted output to the screen.

What is the use of the return statement?

return 0 the statement is the “Exit status” of the program.

Why ;(semi-colon) is placed after every line of code in C Programming language?

;  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 a multi-line comment.

BUY NOW AT AMAZON

 

Leave a Reply

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