C Programming Tutorial
About Lesson

C Introduction

In this tutorial, we will learn about Introduction, History, features & key-points, Advantages & Disadvantages of C, Applications and Compilers of C.


What is C Language?

C is a general-purpose case-sensitive programming language that is extremely popular, simple, and flexible to use. C is one of the oldest, fastest and extremely popular programming language. It is a procedure and structure oriented programming language that is machine-independent and extensively used to write various applications, Operating Systems like Windows, and many other complex programs like Oracle database, Git, Python interpreter, and more.


History of C Language

  • It is developed by Dennis Ritchie at AT&T’s Bell Labs ,USA in 1972. it is one of the most widely used language in the world.
  • It was developed to overcome the problems of previous languages such as B, BCPL, etc.
  • Initially, C language was developed to be used in UNIX operating system. It inherits many features of previous languages such as B and BCPL.
  • C language is well-respected for its portability and low-level functionality.
  • It is used to write high-performance code with faster execution
  • It is portable and can be used to develop applications that can be adapted to multiple platforms.

Features and Key-points of C Language

  • Simple – It is a simple language in the sense that programs can be broken down into small parts, has a rich library support and a variety of data-types.
  • Machine Independent but not Platform Dependent – C programs can be executed on different machines with some machine specific changes.
  • Middle-level Language – C is intended to do low-level programming. It is used to develop system applications such as kernel, driver, etc. It also supports the features of a high-level language.
  • Memory Management – It supports the feature of Dynamic memory allocation. In C language, we can free the allocated memory at any time by calling the free() function.
  • Faster execution – C programs are faster in execution. Since, it is a compiled language, and also highly procedural.

Advantages of C Programming

  • C is the building block for many other programming languages.
  • Programs written in C are highly portable.
  • Several standard functions are there (like in-built) that can be used to develop programs.
  • C programs are collections of C library functions, and it’s also easy to add functions to the C library.
  • The modular structure makes code debugging, maintenance, and testing easier.

Disadvantages of C Programming

  • C does not provide Object Oriented Programming (OOP) concepts.
  • There are no concepts of Namespace in C.
  • C does not provide binding or wrapping up of data in a single unit.
  • C does not provide Constructor and Destructor.

C Compilers and IDE

There ara many C compilers and IDEs are available which you can use to compile and run :

  • Apple C. Xcode (Only supported by Apple OS.)
  • Bloodshed Dev-C
  • Turbo C/C++
  • MINGW – “Minimalist GNU for Windows”
  • Code::Blocks
  • Notepad++

C Get Started

In this tutorial, we will learn about Get Started, Syntax, and Basic Program of C.


Get Started

To Start using C, you need two things:

  • A text-editor (like Notepad++, Code::Blocks and so on.), to write C programming code.
  • A compiler, like GCC, to translate the C code into Assembly language code (the code that computer will understand).

C Compilers and IDE

There ara many C compilers and IDEs are available which you can use to compile and run :

  • Apple C. Xcode (Only supported by Apple OS.)
  • Bloodshed Dev-C
  • Turbo C/C++
  • MINGW – “Minimalist GNU for Windows”
  • Code::Blocks
  • Notepad++

Install IDE

  • An IDE (Intefrated Development Environment) is used to edit and Compile the code.
  • Popular IDE’s include – Code::Blocks, Eclipse, Dev-C++ and Visual Studio.
  • These above mention IDE’s are Open Source and they can be used to edit and debug C code.
  • We recommend Code::Blocks for practice our examples, which we believe is a good place to start coding.

Quickstart

  • Let’s create our First C file in Code::Blocks.
  • Open Codeblocks and go to File > New > Empty File.
  • Write the following C Code and save the file as myfirstprogram.c (File > Save File as):

 

#include <stdio.h>
int main() {
  // printf() displays the string inside quotation
  printf("Hello, World!");
  return 0;
}

Output

Hello World!

Focus on how to run the code. and see the result of the above program.

error: Content is protected !!