EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 600+ Courses All in One Bundle
  • Login

C Commands

Home » Software Development » Software Development Tutorials » C Programming Tutorial » C Commands

C-Commands

Introduction to C Commands

C is an imperative and a general-purpose programming language which is the base of computer and system programming. It supports lexical variable type, structured programming and a state of recursion. C language is used to provide constructs which help in mapping efficiently to the machine instructions and thereby the major use today lies in assembly language which includes operating systems and a couple of application software too. The range varies from embedded systems to supercomputers. The initial purpose of C was to be used as the UNIX operating system programming language. Today it finds most of its applications in compiler designing, operating systems and computer architectures. It is used at places where a low level of memory access and minimum amount of run-time support is required. To execute this language you should be aware of the commands to be used. In this C commands post, we are going to list down the important C commands which will be important to you.

Basic C Commands

Below is some basic C Command that are as follows:

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

1. #include: This is the main header file preprocessor command which includes standard input and output header file 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 c

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

{ c

4. /* abc*/: The text 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.

Popular Course in this category
C Programming Training (3 Courses, 5 Project)3 Online Courses | 5 Hands-on Projects | 34+ Hours | Verifiable Certificate of Completion | Lifetime Access
4.5 (5,570 ratings)
Course Price

View Course

Related Courses
C++ Training (4 Courses, 5 Projects, 4 Quizzes)Java Training (40 Courses, 29 Projects, 4 Quizzes)

abc c

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

Printf

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

Getch

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.

} c

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.

hello word program c

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

return c

Intermediate C Commands

Below are some intermediate C Command that are 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.

for

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.

Initialization

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.

Test

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.

Increment

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.

Statements

6. Return EXIT_SUCCESS: This is the return statement which 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.

Return EXIT_SUCCESS

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

%d

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.

T C

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

n c

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.

if c

Advanced C Commands

Below are some advanced C Command that are as follows:

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

Scanf

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

Format string

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

List of & variables

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.

f c

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

Double c

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

Char c

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

Float

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.

Get c

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

% S

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

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.

Conclusion

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

Recommended Articles

This has been a guide to C Commands. Here we have discussed basic, Intermediate as well as advanced C Commands with appropriate outputs. You may also look at the following article to learn more –

  1. HBase Commands
  2. Pig Commands
  3. Sqoop Commands
  4. Hive Commands

C Programming Training (3 Courses, 5 Project)

3 Online Courses

5 Hands-on Projects

34+ Hours

Verifiable Certificate of Completion

Lifetime Access

Learn More

2 Shares
Share
Tweet
Share
Primary Sidebar
C Programming Tutorial
  • Basic
    • Introduction to C
    • What is C
    • Career in C Programming
    • Advantages of C
    • How to Install C
    • Best C Compilers
    • Data Types in C
    • Variables in C
    • C Keywords
    • C Command
    • Command Line Arguments in C
    • C Literals
    • Constants in C
    • Unsigned Int in C
    • String in C
  • Pointers
    • Pointers in C
    • Null pointer in C
    • Function Pointer in C
    • Double Pointer in C
    • Void Pointer in C
    • Const Pointer in C
    • Dangling Pointers in C
    • Pointer Arithmetic in C
  • Operators
    • C Operators
    • Arithmetic Operators in C
    • Relational Operators in C
    • Assignment Operators in C
    • Logical Operators in C
    • Conditional Operator in C
    • Modulus Operator in C
    • Ternary Operator in C
    • Address Operator in C
    • Unary Operator in C
    • Operators Precedence in C
    • Left Shift Operator in C
  • Control Statement
    • Control Statements in C
    • If Statement in C
    • If-else Statement in C
    • Else if Statement in C
    • Nested if Statement in C
    • #else in C
    • Structure Padding in C
    • Nested Structure in C
    • Continue Statement in C
    • Break Statement in C
    • Switch Statement in C
    • Goto Statement in C
  • Loops
    • Loops in C
    • For Loop in C
    • While Loop in C
    • Do While Loop in C
    • Nested Loop in C
    • Infinite Loop in C 
  • Function
    • Math Functions in C
    • Hashing Function in C
    • Recursive Function in C
    • Power Function in C
    • fputs in C
    • C puts() Function
    • fprintf() in C
    • fseek() in C
    • Stderr in C
    • ASCII Value in C
    • strcat() in C
    • Inline Function in C
    • sizeof() in C
    • Function Prototype in C
    • C ftell()
  • Array
    • Arrays in C Programming
    • 2-D Arrays in C
    • 3D Arrays in C
    • Multidimensional Array in C
    • Array Functions in C
    • Strings Array in C
  • Sorting
    • Sorting in C
    • Heap Sort in C
  • Advanced
    • Constructor in C
    • Encapsulation in C
    • C Storage Classes
    • Static Keyword in C
    • File Handling in C
    • Queue in C
    • Hexadecimal in C 
    • typedef in C
    • Memory Allocation in C
    • Linked List in C
    • Volatile in C
    • Tokens in C
    • Expression in C
    • Regular Expression in C
    • Error Handling in C
    • Types of Errors in C
    • Preprocessor in C
    • Preprocessor Directives in C
    • fscanf() in C
    • #Pragma in C
    • #ifndef in C
    • #undef in C
    • Macros in C
  • C programs
    • Patterns in C Programming
    • Star Patterns in C
    • Number Patterns in C
    • Swapping in C
    • Reverse Number in C
    • Palindrome in C Program
    • Factorial in C
    • Fibonacci Series in C
    • Square Root in C
    • Random Number Generator in C
    • Prime Numbers in C
    • Escape Sequence in C
    • Reverse String in C
    • Leap Year Program in C
    • Anagram Program in C
    • Strong Number in C
    • String Concatenation in C
    • C Programming Matrix Multiplication
    • Decimal to Octal in C
    • Expression Evaluation in C
    • Decimal to Hexadecimal in C
  • Interview question
    • C Programming Interview Questions

Related Courses

C Programming Training Course

C++ Training Course

Java Training Course

Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Java Tutorials
  • Python Tutorials
  • All Tutorials
Certification Courses
  • All Courses
  • Software Development Course - All in One Bundle
  • Become a Python Developer
  • Java Course
  • Become a Selenium Automation Tester
  • Become an IoT Developer
  • ASP.NET Course
  • VB.NET Course
  • PHP Course

© 2020 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

*Please provide your correct email id. Login details for this Free course will be emailed to you
Book Your One Instructor : One Learner Free Class

Let’s Get Started

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA Login

Forgot Password?

EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

Special Offer - C Programming Training (3 Courses, 5 Project) Learn More