Introduction to C Programming Language

Introduction to C Programming Language

In this article, I am going to give you a brief introduction to the C Programming Language. Please read our previous article where we discussed Platform Dependency in C Language. As part of this article, I am going to discuss the following pointers in detail.

  1. What is C Language?
  2. Why C execution is faster?
  3. Is C platform-dependent?
  4. Why C?
  5. Is C preferred for competitive programming?
  6. Why C Language Becomes very Popular:
  7. Advantages and Disadvantages of C.
  8. Applications of C Language.
  9. Features of C Programming Language.
  10. Characteristics of C Language
  11. How does C Program work?
What is C Language?
  1. C is a high-level/middle-level language.
  2. C is a compiler-based programming language.
  3. It is a general-purpose language.
  4. It is a procedure-oriented programming language.

The C Programming Language is a High-Level procedure-oriented structured programming language. Programming Language which is syntactically similar to English and easy to understand is called High-Level Programming Language. When programming language supports module or function implementation then it is called Procedure Oriented Language. Programming Language which follows the TOP-DOWN approach in the form of blocks is called Structured Programming Language.

C is a general-purpose, high-level evergreen, and non-exhaustive programming language that was originally developed by Dennis M. Ritchie in the year 1972 to develop the UNIX operating system at Bell Labs. It is one of the most simple, popular, and flexible programming languages. It was derived from the B language.

It is a machine-independent, structured programming language which is used extensively nowadays to develop various types of applications.

Introduction to C Programming Language
C is a multi-purpose/general-purpose programming language?

Using C language, we can design the applications like

  1. Operating system. Example: dos, Unix, Linux, windows, android, etc.
  2. Editors. Example: Notepad, WordPad, MS-word, etc.
  3. Translators. Example: compiler, interpreter, assemble, etc.
  4. Commercial applications. Example: hotel / super market / college program, etc.
  5. Database. Example: oracle, SQL Server, My SQL, SQLite, etc.
C is a multi-purpose/general-purpose programming language?
  1. Device drivers. Example: audio / video / printer / keyboard /mouse drivers etc.
  2. Media players. Example: VLC Media Player, Windows Media Player, MX Player, etc.
  3. Anti-virus. Example: Avast, Norton, MacAfee, etc.
  4. Embedded applications. Example: Tv / ac / atm programs, etc.
  5. PC & Mobile games
  6. Browsers. Example: I.E, Chrome, Firefox, etc.
  7. Standalone applications. Example: Calculator, Anti-virus, Browsers, Media players, etc.
C is a procedure-oriented programming language [POP]:

Every programming language is having a particular programming structure, which is called programming paradigm [structure].

Before c language, the languages are following a monolithic program structure. In this, the entire program is designed by using a single program. Due to this, it is very difficult to trace the errors and it is going to more memory. Hence the performance is low.

C is a procedure-oriented programming language [POP]
C is a procedure-oriented programming language [POP]

To avoid this problem in the c language a big program is divided into several small programs called subprograms or subroutines or procedures or functions.

Introduction to C Programming Language
Introduction to C Programming Language
  1. Modularity: Dividing a big program into several small modules based on program requirements.
  2. Simplicity: easy to read/understand
  3. Reusability: write once, use many times.
  4. Efficiency: performance is high
Pop Structure:
Pop Structure

C is a pop language

C++, python – pop & oop: multi-paradigm

Java, C# – oop

When a language is following more than one programming structure then it is called muti-paradigm.

Why C language execution is faster?

The C Programming language execution is faster as compared to other high-level programming languages such as Java or C#. The reason is, C language doesn’t require the abstraction layer such as JVM (Java Virtual machine in Java) or CLR (Common Language Runtime in C#). C language directly is compiled and executed on top of the operating system.

Is C programming language platform-dependent?

The c programs are platform-independent but the c executable files are platform-dependent. That means you can write a C program on any platform and can also compile it anywhere. But, once you generate executable files on one platform then you can not run that executable files on other platforms. For example, if you generate the executable files on windows, then you can run only those files on the Windows Operating system but on Linus or any other operating system. You need to re-compile the same program in Linus or any other operating system to get that particular operating system executable files.

Why Learn C Language?

Programming Language C was highly recommended for beginners as it is the base language for many other programming languages. Again C was recommended to understand the basic programming concepts such as data types, operators, control statements, and many more in a clear and precise manner. The Syntax and semantics of the C language were easy to understand and nearly the same as widely used modern programming languages such as C++, Java, and C#. So, learning ‘C’ as the main language will play an important role while studying other programming languages.

Is C preferred for competitive programming?

Yes, In recent years competitive programming (Codechef, HackerRank, TopCoder, SPOJ) gained huge popularity among young programmers. Companies such as Amazon, Google, Microsoft, Facebook want a programmer to be good at Data Structures and Algorithms.

C++ the successor of the C language is highly recommended for competitive programming because, In competitive programming, high priority will be given to both space and time complexity.

Why C Language Becomes Very Popular?
  1. It is one of the legacy programming languages and you can learn it quickly.
  2. The C language is reliable, flexible, simple, and most importantly easy to use.
  3. It is based on structured language.
  4. The C language is considered the mother of all other programming languages.
  5. Most of the Modern programming concepts are inherited from the C language.
  6. Most of the Universities preferred to add C programming in their courseware.
Advantages of C Language:
  1. Platform Dependent: As we copy the .exe file to any other computer which contains windows OS then it works properly because native code is the same. But when the same .exe file if we are copying to any other computer which contains UNIX/LINUX OS then it doesn’t work because the native code is different. This behavior is called Platform Dependency.
  2. Portability: We can carrying the instruction from one system to another system.
  3. Easy: C Language code or syntax is very easy to understand. It uses a keyword like if, else, switch, main, etc. This kind of keyword we all are using in our day-to-day life to get some decisions.
  4. Fast: C compiler is very fast as compared to other language compilers. C compiler can compile around 1000 lines of code in a second. It is more efficient than unstructured code because of the minimized branching of the code.
  5. Readability: Maintenance of the C code is easy due to the readability of the code.
  6. Secured: C program is secured.
Disadvantages of C Language:
  1. C does not have the OOPS feature that’s why C++ is developed.
  2. There is no runtime checking in C Programming Language.
  3. There is no strict type checking (for example we can pass an integer value for the floating data type).
  4. As the program extends it is very difficult to fix the bugs.
  5. C doesn’t have the concept of the namespace, constructors and destructors, Inheritance, Polymorphism, Abstraction, and Encapsulation like Object-Oriented Programming Language (OOPS).
What are the applications of C Language?
  • C is used to develop System software applications like UNIX, WINDOWS, LINUX, and COMPILER DESIGNING.
  • C is also used in the development of many applications like commercial products.
  • C is used in the development of Embedded and Mobile Apps.
  • C Language has good interaction with Hardware.
  • Graphic Frameworks for mobile and PC games are developed using C Language.
Features of C Programming Language

It is a very simple and easy language, C language is mainly used for developing the desktop-based application. All other programming languages were derived directly or indirectly from C programming concepts. This language has the following features:

  1. It is a multi-purpose language. Using C, we can design both system & application software.
  2. C is a procedure-oriented programming language [POP]
  3. C comes with a rich [more] set of operators.
  4. C comes with several predefined / library / built in Example: printf(), scanf(), clrscr(), etc.
  5. C supports user defined functions. Example: fact(), prime(), armstrong(), etc.
  6. Dynamic memory allocation.
Characteristics of C Language
  1. C supports 44 Operators, 32 Keywords, and 14 Separators.
  2. C is a Case Sensitive Language.
  3. Every C statement ends with a semicolon (;).
  4. C language supports a large set of library functions.
  5. C is a Function Oriented, Procedure Oriented, and Structure Oriented Programming Language.
How does C Program work?
  • First, the source code is formed or created (through vi or cd command in UNIX). It is saved with an extension .c, which is known as the source file. For example ked.c
  • The second step is to compile the source code, to check for existing errors (through cc command in UNIX or through Alt+F9 in Turbo C). After compilation, if it is free from errors then the object file is generated, which has the extension .o (in UNIX) or .obj (in Turbo C).
  • The next step is to link the file to existing files (which is automatically done after compilation in UNIX), which generates the executable files .exe (in Turbo c) or stored in a.out (in UNIX, that always gets overwritten, which can be avoided by renaming the file a.out to some other name).
  • The last step is to run or execute the program (through ./a.out in UNIX or through Ctrl+F9 in Turbo C).
Follow Us On