Introduction

0 collinbrownlee November 20, 2020

C Program is a powerful general-purpose, procedural, machine-independent, structured computer programming language and can efficiently work on enterprise applications, games, graphics, and applications requiring calculations.

When I am saying general-purpose, It simply means that It is using for developing applications in a wide variety.

History of C Program:

By 1960 there were a number of programming languages. But almost all were used for a specific purpose only. For example, FORTRAN is developed by IBM. was used for engineering and scientific applications.

To overcome that problem, C language is written and designed by Dennis Ritchie at AT&T’s(Americian Telephone and Telegram) Bell lab for use with the UNIX Operating system by inheriting the feature of and BCPL.

Let’s see the  programming language that are developed before C:

LangaugeYearDeveloped By
Algol1960International Group
BCPL1967Martin Richard
B1970Ken Thompson
Traditional C1972Dennis Ritchie
K & R C1978Kernighan & Dennis Ritchie
ANSI C1989ANSI Committee
ANSI/ISO C1990ISO Committee
C991999Standardization Committee

Feature of C programming:

  • Robust Language: C is a robust language whose rich set of built-in functions and operators can be used to write any complex problem.
  • Efficient and Fast: Program written in C are more efficient and faster due to the variety of data-types and powerful operators.
  • Highly Portable: C is highly portable, meaning that C Program written for one computer can be run on another computer with litte or no modifications.
  • Structure Language: C is structured language as it has fixed structure. A program can be divided into number of modues or block.
  • Extendibility: A C Program may contain a number of user defined functions. We can add our own user defined functions to the C Library if required.
  • Middle Level Language: C is a middle level language because it combines the best part of high level language with low level language.
  • Rich System Library: There are numers of built in functions, keywords and operators in C’s System Library organized in different header files.Using built-in functions, we can save our effort and reduce the size of the program.

Hello World in C++

Here, We will write a simple program that will display Hello World message. We will discuss each part in detail.

#include <stdio.h>

int main(){
    
    // This is the single comment

    /*  This
     *       is
     *         multiple comment
     */

    printf("Hello World");

    return 0;
}

The output of the above program is:

Hello World

Let’s discuss all the lines of the above program in detail.

1. Comments

Here we can see two types of comments in the above program. Comments are the explanation or description of source code that does not affect your program logic in any way. Comments are neglected by compilers or interpreters.

// This is single line comments

/*
*    This
*        is
*          the multiple line comment.
*/

2. #include <stdio.h>

This statement tells the compiler to include stdio.h from the library. This library contains input-output functions such as printfscanf, etc.

4. init main()

This is the mainfunction of our program from where the program start to execute. intmeans the return type of that function which tells the compiler that this function return integer type value.

5. printf(“Hello World”)

printfis an object that is presented in stdio.h library. The objective of this is to print the statement as a output. This object print inside the value include in double quote (“”) and it also can display variable values. 

6. return 0

This statement return 0 value from main function which state that execution is completed. return 1 state that execution is failed.

How to Learn C Progam?

  • Code Help Pro Tutorials: You can learn C Programming using our free tutorials, projects, and examples.
  • Official Documentation: You can use official documentation to learn C Programming.
  • Write Code: Most effective way to learn programming is to write a lot of code.