C Programming
eBook - ePub

C Programming

Learn to Code

Sisir Kumar Jena

Share book
  1. 428 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

C Programming

Learn to Code

Sisir Kumar Jena

Book details
Book preview
Table of contents
Citations

About This Book

The C programming language is a popular language in industries as well as academics. Since its invention and standardized as ANSI C, several other standards known as C99, C11, and C17 were published with new features in subsequent years. This book covers all the traits of ANSI C and includes new features present in other standards. The content of this book helps a beginner to learn the fundamental concept of the C language. The book contains a step-by-step explanation of every program that allows a learner to understand the syntax and builds a foundation to write similar programs. The explanation clarity, exercises, and illustrations present in this book make it a complete textbook in all aspects.

Features:



  • Other than ANSI C, the book explains the new C standards like C99, C11, and C17.


  • Most basic and easy-to-follow programs are chosen to explain the concepts and their syntax.


  • More emphasis is given to the topics like Functions, Pointers, and Structures.


  • Recursion is emphasized with numerous programming examples and diagrams.


  • A separate chapter on the command-line argument and preprocessors is included that concisely explains their usage.


  • Several real-life figures are taken to explain the concepts of dynamic memory allocation, file handling, and the difference between structure and union.


  • The book contains more than 260 illustrations, more than 200 programs, and exercises at the end of each chapter.

This book serves as a textbook for UG/PG courses in science and engineering. The researcher, postgraduate engineers, and embedded software developers can also keep this book as reference material for their fundamental learning.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is C Programming an online PDF/ePUB?
Yes, you can access C Programming by Sisir Kumar Jena in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in C. We have over one million books available in our catalogue for you to explore.

Information

Year
2021
ISBN
9781000460582
Edition
1

1 Introduction to the Computer

DOI: 10.1201/9781003188254-1

1.1 Introduction

Perhaps the most powerful and resourceful tool ever created by humanity is the computer. The term “computer” could mean a device that calculates. But nowadays a computer can do a variety of jobs. If you take any field, be it engineering, healthcare, automotive devices, gaming, or entertainment, everywhere a computer is used to do the task. This chapter introduces how computers came into existence and describes the different components associated with a computing device. After completion of this chapter, the reader will have learnt the following:
  1. What a computer is, and how may we define it.
  2. A brief history of the computer and how it came into existence.
  3. What the different components of a computer system are, and how they are organized.
  4. Be able to define a memory subsystem, its categories, and its organization.
  5. Understand the importance of an Operating System (OS) and its functionality.
This chapter’s content is purely elementary and not meant for those who know the basics of computer systems. Those with a moderate knowledge of any computer language can skip this chapter. We will start the chapter by introducing the definition of a computer system and its characteristics.

1.2 Definition and Characteristics of a Computer System

The development of a computer system has a long history, which includes the work done by several great minds. In this modern era, we can consider a computer as a system that processes data and produces useful information. Though there is no formal definition that defines a computer, we will try to propose a definition:
A computer is an electronic device that receives input through an input device, stores it in the storage device (memory), and manipulates or processes the data to produce information (output) through an output device.
Analyzing the definition, you may notice four crucial components of a computer system: (1) input device, (2) output device, (3) storage device, and (4) the processing device. The overall organization of all these components is discussed later in this chapter. The above defines a computer system as a data processing machine. But it is not only a data processing unit. Rather, it has several capabilities that need to be discussed here in the form of its characteristics. We could not complete the definition without knowing the characteristics of a computer system. Figure 1.1 shows the essential characteristics of a computer system collected from [1].
  • Speed: A computer is a high-speed electronic device which takes a negligible amount of time to perform any task compared to the speed of any human being.
  • Accuracy: Computers are very accurate in producing the correct output. A computer produces the wrong result only when the user has made a mistake.
  • Automatic: Computers execute the task assigned to them without any intervention until the job gets finished.
  • Diligence: Computers never tire. They can work continuously and produce correct and consistent results every time.
  • Versatility: A computer is capable of doing different tasks. We all know that nowadays computers are used everywhere.
  • Memory: A computer is potent at remembering things and never forgets them. Whatever we store in computer memory will be there throughout its lifetime.
Five characteristics of the computer showing as bubbles around a computer icon.
Figure 1.1 Characteristics of a computer.

1.3 History of the Computer

The computer has a long history of development. The objective of this book is something different. So in this section, we only provide an overview of how the computer came into existence by highlighting some inventions. The origin of the entire development is not essential to us, but I would like to start with Charles Babbage’s (see Figure 1.2a) contribution. He is known as the father of the digital programmable computer.
Figure 1.2 (a) Charles Babbage; (b) John von Neumann.
The work of Babbage describing a “difference engine” was used by many researchers as inspiration for further development [2], leading to several working models but with the disadvantage that the programs were hardwired and challenging to change. A final and major contribution was made during the 1940s by John von Neumann (see Figure 1.2b), known as the “stored program.” With a stored program, we can control a computer system’s activity, and this program is usually stored inside the computer’s memory [2]. In today’s modern world, digital computers are all built based on this stored-program concept. A brief contribution to computer development in chronological order is [3]:
  • The German philosopher and mathematician, Gottfried Leibniz (1646–1716), built the first calculator to perform multiplication and division. It was not reliable due to the inaccuracy of its parts.
  • Charles Babbage (1792–1872) (Figure 1.1a) was a British inventor who designed his difference engine in 1822 and, in 1842, came up with an “analytical engine” incorporating the ideas of a memory and card input/output for data and instructions. But he was not able to build the system. Babbage is mostly remembered for and considered as the father of digital computers.
  • Howard Aiken (1900–73), a Harvard professor with IBM’s backing, built the Harvard Mark I computer (51 ft long) in 1944. It required three seconds to perform multiplication.
  • John Vincent Atanasoff built a specialized computer in 1941 and was visited by Willaim Mauchly before constructing the Electronic Numerical Integrator and Calculator (ENIAC).
  • J. Presper Eckert and Mauchly designed and built the ENIAC in 1946 for military computations. It used vacuum tubes (valves), which were totally electronic (and operated in microseconds), instead of the electromechanical relay.
  • Von Neumann was a scientific genius and a consultant on the ENIAC project. In 1950, he formulated plans with Mauchly and Eckert for a new computer, the Electronic Discrete Variable Automatic Computer (EDVAC), which was to store programs as well as data.
  • At the same time (1950), another computer named the Electronic Delay Storage Automatic Calculator (EDSAC) was developed by Maurice Wilkes at Cambridge University in England.
  • After the above inventions, every computer built followed the von Neumann architecture. Several generations of computers have been developed, but the overall architecture remains the same.
The reader of this book is encouraged to find out more on computer generations and present computer system scenarios.

1.4 Basic Computer Organization

Before we can understand basic computer organization, see Figure 1.3 of a desktop computer system and its components. There are five components that we usually see: (1) the keyboard; (2) the mouse (3); the monitor; (4) the cabinet; (5) the speaker. We also see some other components, ...

Table of contents