Commands Of C Language

Commands Of C Language
Written by Shuvhojit DebJanuary 31, 2022
12 min read
Shuvhojit Deb

Full Stack Developer

There are many kinds of commands needed in the C language. Let's have a discussion about it.

What are the Commands of C?

C is an imperative and a general-purpose programming language that's the base of computer and system programming. It supports verbal variable type, structured programming, and a state of recursion. C language is used to give constructs that help in mapping efficiently to the machine instructions and thereby the major use moment lies in assembly language which includes operating systems and a couple of operation software too. The range varies from bedded systems to supercomputers. The original purpose of C was to be used as the UNIX operating system programming language. Moment it finds utmost of its operations in compiler designing, operating systems, and computer infrastructures. It's used at places where a low position of memory access and minimal quantum of run-time support is needed. To execute this language you should be apprehensive of the commands to be used.

Basic C Commands

Some basic C Commands are following:

1. #include: This is the main header file preprocessor command which includes standard input and output header files such as stdio.h from the C library repository before the program is compiled.

#include c

2. int main(): This C command, as in most of the programming languages is the main function which is generally the starting point of the program execution. All other methods and functions are called once the primary main () is executed.

int main ()

3. {: These are the curly braces that are not only C language-specific but are common in any programming language. This indicates the beginning of a method or a function definition.


4. /* abc*/: The text is written inside the /* and */ will be treated as comments and won’t be used for execution or compilation. This is just to give a clear understanding to the programmer about the complexities.

/*This program is for
Hello World.*/

5. Printf: This C command is used to print the output to the console screen.

printf("Hello World");

6. Getch(): This command is used to wait for any input from the user.


7. Return 0: This C command is used to terminate the C program or main function and returns 0.

return 0;

8. }: These curly brackets are used to close the function or method block.


9. //: These are known as the single-line comments which are not only used specifically in C language but in any other programming language as well.

//This is a hello world program.

10. Return: This command is used to return the output from the code execution.


Intermediate C Commands

Below is some intermediate C Command that is as follows:

1. For This is the looping C command which is used when you know the definite loops. This is also referred to as iteration which consists of a specific set of commands needed to execute them for a statement.


2. Initialization: This is the initial part of the loop which consists of initializing the variable part.

This is essential to know the starting point of the looping construct.

( i = 1 ;

3. Test: This is the middle portion of the loop which is used to tell the condition last iterative point i.e. the last point till where the condition will be met and the command will execute.

i <= 10;

4. Increment: This value is used to tell the level of increment needed for the looping construct. The flow of code execution will go as the increment value is defined.

i = i+1 )

5. Statements: This is the body text of the loop which contains the actual logic of the program. This can go to any number of lines as the need be.

      printf("%d\t Hello! \n", i);

6. Return EXIT_SUCCESS: This is the return statement that is used to tell the system about the normal termination of the program. Stdlib.h header file is a mandatory file for this to work.


7. %d: This is the format specifier to denote integer-type characters. It is used to format the output.


8. \t: This is the command for using a tab or a blank tab of horizontal space. This is used for the formatting of the program and comes under the category of escape sequences.


9. \n: This is another format specifier escape sequence that is used to break into a new line.


10. %lf: This is the format specifier for double type floating literal which has a wider range and a higher value than the float type.


Advanced C Commands

Below is some advanced C Command that is as follows:

1. Scanf: This C command is used to take the user input from the standard console terminal window.


2. Format string: This is the string used to define the various types which have to be read.

"%if  |%if"

3. List of & variables: These contain the variables which form the part of the format string. This may contain any number of variables preceded by & symbol.

&x, &epsilon

4. %f: This is used to define the floating-point values i.e. the values contained with the decimals. Its range is comparatively less if compared to the double-type variable.


5. Double: This is used to assign a double type to the variable name following it.

double x, y, z = 1.0;

6. Char: This is the command which is used to define any variable contained with the char datatype.

char a= 'A', b, c='C';

7. Float: This is used to define a floating kind of value to the variable.

float test1 ;

8. Gets(): This C command is used to read the string type statement from the standard input device and keeps it until it finds a newline character. It doesn’t check the array bound.


9. %s: This is the format specifier used for denoting string type variables.

%s\n", buf);

10. fgets(): This C command is used to read the string type value until the new line or when the maximum array limit is reached. It checks the array bound value.

fgets(buf, MAX, stdin);

Tips And Tricks to use C Commands

Make use of the goto (->) operator will be of use as it is used to govern the program control flow. Make use of frequently used macros. The c programming language is not like any other programming language such as Java, etc. therefore, the specifics such as pointers and addresses must be used wisely.


These C commands are the ones that will be used by you more often than not if you have chosen to make your career in the C language. Please feel free to post your queries and keep following us to get fresh new posts.

C Language
C Commands
C Integers
Was this blog helpful?
You must be Logged in to comment
Code Block

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance