Introduction to C Programming

History of C Language

Every computer language is designed for some specific purpose. For Example FORTRAN (Formula Translator) was designed for scientific and mathematical calculations, COBOL (Common Business Oriented Language) was designed to handle business applications. C language was not an exception. Initially it was designed for programming in the operating system called Unix. Later, It became the language in which whole operating system Unix was rewritten. The C language was developed in 1970 at Bell laboratories by Dennis Ritchie.

C-Programming-in English

Learn C Programming (English)


In 1982 A committee was formed by ANSI (American National Standards Institute) to make standards for C language. and finally in 1989 the standard for C language was introduced known as ANSI C.

C-Programming-in-Hindi

Learn C Programming (Hindi)



Characteristics of C Language

C is a high level language. It has the simplicity of a high level language as well as the power of a low level language. This characteristic of C language makes it suitable for writing both application programs and system programs. C is small language which only consist of 32 reserved words known as keywords(like - if, else, do, while etc.). C comes with inbuilt header files which provides functions that extends the power of C language. Examples of such Header files includes stdio.h (contains basic input output functions), math.h (contains basic maths functions and formulas), string.h(contains string related functions) etc. 

C is a High level language, the statements of C language consists of English like words but the computer does not understand these English statements so these English statements are first translated through a a software program known as Compiler into the machine language or binary language. C uses a Compiler for converting High level Language to Binary Language

We have defined important programming questions, which are not the part of C Programming but still are important in the Question Bank section.

Your First C Program

#include<stdio.h>
void main() {
     printf("Hello World!");
}

Click on 'Run this program' to play with the code and change the value inside printf function.

Explanation of the Code


The first line of the program includes the "stdio.h" header file.
#include<stdio.h>
stdio.h Header file contains standard input/output functions. Header files are the documents or files which contains the pre-defined functions. Header files may be understood as the dictionaries which contain the meanings of the various functions used in the program.

Next line is the starting point of our program called the main function
void main(){
'void' is the return type of the function which means that the function does not return any value. 'Void' means null value. main() is the predefined function which is the starting point of any program in C language. Every C program must contain a main() function. Each function starts with the opening curly brace '{' and ends with the closing curly brace '}'. The main function contains only one statement that is:
    printf("Hello World!");
printf() is a function which prints the value written inside its brackets or parentheses '()' as called in C language. Note that each C statement must be ended with a semicolon ';' .

Summary of the Explanation
  • First, the header file is included.
  • Next is the main function which starts with Opening curly brace. main function is the starting point of the our program.
  • Next is the printf function which prints "Hello World!" on the screen.
  • Each C statement must be ended with a semicolon.
Note : Always remember that C is a case sensitive language which means that the words that are written in small letters should be written exactly the same like main function should be start with small 'm' not the capital 'M'. Similarly, the printf function should have a small 'p' not a Capital 'P'.

Learn C programming in Hindi

Learn C programming in English

  • C Basics
  • Operators and Precedence
  • Control Statements
  • Functions
  • Arrays & Pointers
  • Strings
  • Structure & Union
  • Bitwise-Operators
  • Libraries and Files



Post a Comment