0% found this document useful (0 votes)
2 views4 pages

Basic C Language Programming: Objectives

C is a general-purpose programming language developed in the early 1970s, primarily for writing the Unix operating system. The chapter outlines the objectives of learning C, its advantages such as portability and efficiency, and disadvantages including its complexity for novices. It also distinguishes between compilers and interpreters in the context of program execution.

Uploaded by

Rhean Jane Asur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views4 pages

Basic C Language Programming: Objectives

C is a general-purpose programming language developed in the early 1970s, primarily for writing the Unix operating system. The chapter outlines the objectives of learning C, its advantages such as portability and efficiency, and disadvantages including its complexity for novices. It also distinguishes between compilers and interpreters in the context of program execution.

Uploaded by

Rhean Jane Asur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

BASIC C LANGUAGE PROGRAMMING

C is a general-purpose programming language. It has closely associated with the


UNIX system where it was developed, since both the system and most of the programs that
run on it are written in C. The language, however, is not tied to any one operating system or
machine; and although it has been called a "system programming language" because it is useful
for writing compilers and operating systems, it has used equally well to write major programs
in many different domains.

Objectives :
At the end of this chapter, you will be able to:
 Learn the basics of computer programming and problem solving using C.
 Know the advantages and disadvantages of C language.
 Learn the different data types and operators available in C.
 Understand a variety of C's program control statements.
 Learn the use of arrays in C.

A. Brief History of C Language

Late 1960s- BCPL (Basic Combined Programming Language) was designed by Martin
Richards of University of Cambridge.

1970 - B language was designed by Ken Thompson of AT&T Bell Laboratories for systems
programming. (Accounts differ regarding the origins of the name "B".
Ken Thompson credits the BCPL programming language, but he had
also created a language called "Bon" in honor of his wife Bonnie)

1972 - C language was designed by Dennis Ritchie, also of AT&T Bell Laboratories, for
writing the Unix operating system. (It was named "C" because many
of its features were derived from B language.

1970s, 80s - Unix and C gained wide popularity.

1989 C standardized: ANSI (American National Standards Institute)


standard X-3.159-1989.

1990 C adopted as an international standard by ISO (International


Organization for Standardization): ISO 9899: 1990.

1990s - Minor amendments made to the standards.


B. Advantages and Disadvantages of C Language
Given below are the advantages and disadvantages of c language.
Advantages:
 C is real world language, widely available and popular among programmers.
 C a small, efficient, powerful, flexible and versatile programming language. It
can be used to develop program for all sorts of applications.
 C has been standardized (adhering to the ANSI standard), making it portable
across different computing platforms. Very little modification is required when
moving across platforms, e.g., a program written in DOS will still be compiled
in UNIX with hardly any changes in the code.
 C is close to the computer hardware revealing the underlying architecture to
provide enough low level access to be suitable for embedded systems.
 C is a high level language allowing complex systems to be constructed with
minimum effort.
 C's use of libraries makes it adaptable to many different application areas.
 The Unix operating system was written in C and supports C.
 C gave birth to C++, widely used for applications programming and more
recently Java which was based upon C++.
 Many other languages borrow from C's syntax: e.g., Java, JavaScript, Perl etc.

Disadvantages:

 C is not really a language for novices; it was designed for professional users.
 There are many things that can go wrong if you're not careful. Small typing errors
can cause unwanted effect.
 C lacks much of the automatic checking found in other high level languages.
 Does not support modern concepts such as object orientation and multi-threading

C. Compilers Versus Interpreters


The terms compiler and interpreter refer to the way in which a program is executed. In
theory, any programming language can be either compiled or interpreted, but some languages
are usually executed one way or the other. For example, Turbo BASIC is usually interpreted
and C is usually compiled (C interpreters have some value as debugging aids). The way a
program is executed is not defined by the language in which it is written. Interpreters and
compilers are simply sophisticated programs that operate on your program source code.
An interpreter reads the source code of your program one line at a time and performs
the specific instructions contained in that line. A compiler reads the program and checks the
whole program for syntax errors but does not execute any of the code. The
output of this process is called the object code, which is a translation of the program source
code into a form that can be directly executed by the computer. Object code is also called
binary code and machine code. Once a program is compiled, a line of source code is no longer
meaningful in the execution of the program.

Figure C.1 illustrates how an interpreter does the translation while the flowchart in
Figure C.2 shows the compilation process.

Figure C.1 How an Interpreter Translates a Figure C.2 How a Compiler Translates a
Program Program

You might also like