Fundamentals of C Programming / PDF




Fundamentals of C Programming / PDF






Table of Contents:





Chapter 1 – Introduction

1.1 Introduction to Programming 1
1.2 Program Development 1
1.2.1 Define the Problem 1
1.2.2 Outline the Solution 2
1.2.3 Develop the Algorithm 2
1.2.4 Test the Algorithm for Correctness 2
1.2.5 Code the Algorithm 2
1.2.6 Compile 2
1.2.7 Run the Program 2
1.2.8 Test, Document and Maintain the Program 3
1.3 Running a Program 3
1.4 Programming Languages 4
1.5 Overview of C 5
1.6 Steps in Developing a Program in C 5

Chapter 2 – Introduction to C Programming

2.1 An Example C Program 7
2.2 Your First C Program 7
2.3 C Tokens 8
2.4 Displaying Text 9
2.4.1 Escape Codes 10
2.5 Data Types 10
2.5.1 Primitive Data Types 11
2.5.2 Modifiers 11
2.6 Variables 12
2.6.1 Declaring Variables 12
2.6.2 Constants 12
2.7 Displaying Numbers 13
2.8 Formatted Input 15

Chapter 3 – Operators in C

3.1 Assignment Operator 16
3.2 Arithmetic Operators 17
3.2.1 Increment and Decrement Operators 17
3.2.2 Precedence and Associatively of Arithmetic Operators 18
3.3 Relational and Logical Operators 18
3.3.1 Precedence of Relational and Logical Operators 18
3.4 Bitwise Operators 19
3.4.1 Shift Operators 21
ii © Department of Computer Science and Engineering

Chapter 4 – Conditional Control Structures

4.1 The if Statement 22
4.2 The if-else Structure 24
4.3 The if-else-if Ladder 24
4.4 Nesting Conditions 26
4.5 Conditional Operator 26
4.6 The switch Construct 27

Chapter 5 – Control Structures

5.1 The for loop 30
5.2 The while Loop 31
5.3 The do-while Loop 32
5.4 Nesting of Loops 33
5.5 The break Keyword 34
5.6 The continue Keyword 35
5.7 The exit Function 35

Chapter 6 – Arrays

6.1 Initialising an Array 36
6.2 Multidimensional Arrays 37

Chapter 7 – Functions

7.1 A Function 38
7.2 Function Prototypes 39
7.3 Function Definition 39
7.4 Passing Variables to Functions 41
7.4.1 The Scope of a Variable 41
7.4.2 Default Parameters 41

Chapter 8 – Pointers

8.1 Declaring Pointers 43
8.2 Text Strings and Pointers 44
8.3 Pointers and Arrays 45

Chapter 9 – Handling Files

9.1 The File Protocol 46
9.1.1 Opening a Connection to a File 46
9.1.2 Closing the Connection to a File 47
9.1.3 Reading Data from a File 47
9.1.4 Writing Data to a File 48


-------------------------------



Sample of the pdf document :







1 - Introduction

1.1 Introduction to Programming:

Software refers to a program or set of instructions that instructs a computer to perform some task.
Software can be divided into two major categories called system software and application software.
Systems software includes operating systems and various device drivers. Application software are
used to perform real-world tasks and solve specific problems.

A program is simply a set of instructions that tells a computer how to perform a particular task.

Programs are developed using programming languages. Computer programming is the art of developing computer programs. Programming is rather like a recipe; a set of instructions that tells a cook how to make a particular dish. It describes the ingredients (the data) and the sequence of steps
(the process) on how to mix those ingredients.

A programming language provides a set of rules to develop a program. A person who writes a program using a programming language is called a programmer. His/her job is to convert a solution to a problem (i.e. algorithm) into set of instructions understood by a computer. The programmer should
also test the program to see whether it is working properly and corrective actions should be taken if not.



1.2 Program Development

Developing a program involves a set of steps:

1. Define the problem
2. Outline the solution
3. Develop an algorithm1
4. Test the algorithm for correctness
5. Code the algorithm using a suitable programming language
6. Compile and correction of compile errors
7. Run the program on the computer
8. Test, document and maintain the program


Most of these steps are common to any problem solving task. Program development (software development) may take several hours, days, weeks, months or years. After development, customers will make use of the system. While in use, the system needs to be maintained. The maintenance phase will continue for several months, years or even several decades. Therefore software development is not a onetime task; it is a lifecycle where some of the above steps are reformed again and again. The steps are discussed in the following............







 Click here for  Download PDF / FREE

Fundamentals of C Programming / PDF






2 commentaires:

  1. The above shared pdf is very informative, you can also Learn Computer Fundamentals in C with Our Adaptable Online Videos Course Materials Video Lectures on Computer Fundamentals in C from Superior Faculty.

    RépondreSupprimer