C - IntroductionC - Hello World ProgramC - Exercise 1C - Basic structure of a C programC - TokensC - Data TypesC - Type ConversionC - Exercise 2C - Character Input Output OperationsC - Input Output operation using scanf and printf functions


C - Arithmetic OperatorsC - Relational OperatorsC - Logical OperatorsC - Assignment OperatorsC - Increment Decrement OperatorsC - Bitwise Operators

Precedence and Associativity

C - Precedence and AssociativityC - Exercise 3


C - If Else decision making statementsC - Switch Case decision making statements


C - While LoopC - Do While LoopC - For LoopC - Exercise 4


C - ArraysC - Two Dimensional ArraysC - Multi Dimensional ArraysC - Exercise 5


C - StringC - Exercise 6C - String Manipulation


C - FunctionsC - Functions CategoryC - Function Call - Flow of ControlC - RecursionC - Functions and ArraysC - Functions and Strings


C - StructuresC - Structures and ArraysC - Passing structure to functionC - Function returning structureC - Structure in Structure


C - PointersC - Pointers and VariablesC - Pointers and Variables Memory RepresentationC - Pointers Chaining

Pointers and Arrays

C - Pointers and One Dimensional ArrayC - Pointers and Two Dimensional ArrayC - Array of Pointers

Pointers and Strings

C - Pointers and Strings

Pointers and Functions

C - Pointers and Functions - Call by Value and Call by ReferenceC - Function returning pointer

Pointers and Structures

C - Pointers and StructuresC - Pointers and Array of StructuresC - Passing structure pointer to function

Handling Files

C - File Handling - Getting StartedC - File Handling - Read and Write CharactersC - File Handling - Read and Write IntegersC - File Handling - Read and Write multiple dataC - File Handling - Randomly Access Files

Command Line Arguments

C - Command Line Arguments

Dynamic Memory Allocation

C - Dynamic Memory Allocation - Getting StartedC - Dynamic Memory Allocation - malloc functionC - Dynamic Memory Allocation - calloc functionC - Dynamic Memory Allocation - realloc function

C - Introduction

C Programming

Next →

This is an introduction to C programming language.

Brief History

Dennis Ritchie in 1972 at AT&T Bell Laboratories designed C. In the year 1989, American National Standards Institute approved a version knows as ANSI C.

Important points about the C programming language

C is a structured programming language. We can break up a problem into small modules or function blocks and then join them together to get the complete program.

C source code is compiled.

A compiler reads the entire source code and converts it into object code also referred to as machine code or binary code. Source code is written in human understandable form so, it is necessary to translated it into machine code using compiler which the computer can execute easily.

It is a free-form language i.e. the compiler is not worried about from where we start writing our code.

C programs are a collection of modules or functions. These functions are either user-defined functions, written by a programmer, or standard library functions, provided by the compiler.

Many other programming languages like C++, Java, PHP, JavaScript etc. have borrowed their syntax or were inspired from the C programming language. In fact C++ is a superset of C and is also referred as "C with Classes".

Writing C code

In order to write and compile C code we will need a compiler.

You can use any of the following IDEs for writing and compiling C program.

.c extension

We save C source code in a file with the .c extension.

Example: foo.c

Print "Hello World"

Open your IDE and create a new file lets say, helloworld.c and write the following code inside it.

#include <stdio.h>

int main(void) {
  printf("Hello World");
  return 0;

We will cover the details of the above code in the later tutorials.

Now, if you run this file (compile and execute) you will get "Hello World" as the output.

Next →