Introduction of C- Language



C language basics
Introduction of C- language


C programming language is a structured programming language. It is a procedural-oriented, mid-level programming language. It is developed in 1972 by Dennis M. Ritchie at the Bell Telephone Laboratories to develop the UNIX operating system. It was invented to write an operating system called UNIX and it is a successor of B language which was introduced around
early 1970. The language was formalized in 1988 by the American National Standard Institute(ANSI).

What is C language?

C is the most widely used computer language, it is a general-purpose, imperative programming language. It is also known as a mother language cause of all the modern programming languages, most of the compilers, J .V. M. Kernels, etc are written in C language and most of the programming languages follow C syntax, for example, C++, and Java, C#, etc. It provides the core concepts like the array, strings, functions, file handling, etc, that are being used in languages like C++, java, C#, etc. These days, the most popular Linux OS and Relational Database management system(R-DBMS)., My SQL has been written in C.

Let us explain the features of C programming language and why anybody says it structured programming language, procedural-oriented language, and mid-level programming language

What is Procedural Oriented Language?

Procedural-oriented language-- Procedure-oriented programming basically consists of writing a list of instructions(or actions) for the computer to follow and organizing these instructions into groups known as functions. We normally use a flowchart to organize these actions and represent the flow of control from one activity to another. In the procedure-oriented approach, the problem is viewed as a sequence of things to be done such as reading, calculation, and printing. A number of functions are written to accomplish these tasks. The primary focus is on functions. A typical program structure for procedural programming is shown the technique of hierarchical decomposition has been used to specify the tasks to be completed for solving a problem

                                                                 Main program
                                                             ↙                ↓             ↘
                                                Function-1       Function-2       Function-3
                                                      ↘                ↙   ↓       ↘             ↙       
                                                         Function-4           Function-5
                                                          ↙         ↘            ↙          ↘
                                             Function -6        Function-7     Function -8
                           
                                        Typical Structure of procedure-oriented program

While we concentrate on the development of functions, very little attention is given to the data that are being used by various functions. What happens to the data? |How are they affected by the functions that work on them?
                                                        Global data                                     Global data
                                       
                                                    ↙                    ↘              ↘          ↙         ↙        ↘
                                         
                                             Function-1              Function-2               Function-3     
                                       
                                             Local data                    Local data                 Local data   

                               Relationship of data and functions in procedural programming 

In a multi-function program, many important data items are placed as global so that they may be accessed by all the functions. Each function may have its own local data.

Global data are more vulnerable to an inadvertent change by a function. In a large program, it is very difficult to identify what data is used by which function. In case we need to revise an external data structure, we also need to revise all functions that access the data. This provides an opportunity for bugs to creep in.

What is the Structured programming language?

The structured programming language- Structured programming language means in a c language, large programs are divided into smaller programs known as functions or blocks and Data moves openly around the system from function to function. And in other words, we can say, we break the particular program into parts using functions. It makes the program easy to understand and modify.                                                                    

What is Middle- Level programming language?

 The Middle-level programing language--  Basically computer languages are divided into 3 categories like High- level Middle-level and Low-level. BASIC, COBOL, FORTRAN, and PASCAL fall into the category of High-level languages. Assembly language falls into the low-level language. as we before say that C is a middle-level programming language. it means it supports the feature of both low-level and high-level languages. C language program is converted into assembly code, it supports pointer arithmetic (low-level) but it is also machine-independent ( it is a feature of high-level). A low-level language is specific to one machine, or machine dependent. It means it is machine-dependent, and fast to run. But it is not easy to understand instead a high-level language is not specific to one machine, or in other words, it is machine independent, and it is easy to understand.


Mother language -- C is also called the mother language case all modern programming languages compilers J.V.M.(Java virtual machine) Kernels are written in C language. It provides the core concepts like the array, strings, functions, file handling, etc, that are being used in other languages like C++, Java, and C#.

Common facts of C language are C is a middle-level language. MS-C is a C compiler it is developed by Microsoft USA. Microsoft-C provides an integrated environment to develop C programs. MS-C provides On-Line Help on any command. MS-C menu is activated by pressing the Alt key.   


Structure of A c program

main()
{
         define variables;
         c statements
            .................
            .................
  }          

# include <stdio.h>

int main()

{

printf("Hello C language");

return(0);
}                                                                                                              

or we can also write it following

# include<stdio.h>
void main()
{
printf("Hello C language");
getch();
}

Explanation --Here #include<stdio.h> --is a preprocessor directive command. This command tells the compiler to include the contents of stdio.h file (Standard input output header file )in the program. The Studio. h file contains functions such as scanf() and printf() to take input and display output on our console or monitor. If you use printf as a function without writing #include<stidio.h>, the program will not be compiled. The execution of a C program starts from the main () function.  here( int is an integer type and void is a void means an empty value will return in this program) The printf() displays "Hello C Language" text on the screen or monitor or console. The return 0, statement, and getch() function both are the "exit status" of the program in simple turns program with this statement.

Instructions    -- 
  1.  Write this (above written text) program into any text editor like notepad or notepad++ and Save it. C file Extension by pressing the Ctrl+S key. or go to the file menu and click on the save command. like Hello. c
  2. And open your compiler like turboc+ and open your written program. Like hello. c.
  3.  For a compilation of this program file(Hello. c)-- press the Alt+F9 keys together.
  4. For the execution of this program file(Hello. c)--- Press the Ctrl+F9 keys together.
      

Comments

Popular posts from this blog

Cascading Style Sheet

Computer introduction

Introduction of C ++ Language