You are on page 1of 1

C Programming Basics

Introduction

Welcome to the world of programming! In this course, you will learn how to write a program using Turbo
C.

What is computer programming?

Computer programming is creating a sequence of instructions to enable the computer to do something.

Computer programming has five stages.

1. Problem statement. The programming process begins with a clear, written statement of the
problem to be solved by the computer.
2. Algorithm development: Once the problem has been clearly stated and all the requirements have
been understood, the next step is to develop the program logic necessary for accomplishing the
task.
An algorithm is defined as a logical sequence of steps that must be performed in order to
accomplish a given task.
Sample Tool: Flowchart
3. Program coding: When the programmer is satisfied with the efficacy of the logic developed in the
preceding step, it is time to convert that logic (in either flowchart or pseudocode form) to the
specific syntax of the programming language that will be used.
4. Program testing: The coded program is next checked for errors.
5. Program documentation: The programming process is complete when the program has been fully
documented.

Before we start with learning how to write C codes, let’s have first the three common programming errors.

1. Syntax error occurs when your code violates one or more grammar rules of C and is detected by
the compiler as it attempts to translate your program. Note that if a statement has a syntax error,
it cannot be translated and your program will not be executed.
2. Run-time error is a detected error and displayed by the compiler during the execution of the
program. It occurs when the program directs the computer to perform illegal operation, such as
dividing a number by zero or an attempt to perform an invalid operation, and detected during
program execution. When a run-time error occurs, the computer will stop executing your program
and will display a diagnostic message that indicates the line where the error was detected.
3. Logic Errors occur when a program follows a faulty algorithm. It does not cause a run-time error
and does not display error messages, so is very difficult to detect. The only sign of a logic error
may be incorrect program output.

Brief Turbo C History

Turbo C was developed by Dennis MacAlistair Ritchie at AT&T Bell Laboratories.

What is Turbo C?

Turbo C is an Integrated Development Environment and compiler for the C programming language from
Borland. First introduced in 1987, it was noted for its integrated development environment, small size,
extremely fast compile speed, comprehensive manuals and low price.

You might also like