Algorithms – Chapter 5

Loop or repeat Thanks to iterative statements, it is possible to repeat the execution of a statement more than once. A loop consists of executing a sequence of instructions or blocks more than once in language C. In most languages there are two types of repetition: Where the continuation of the repetition of the instructions …

Algorithms – Chapter 4

Introduction Mathematical intuition The logic of everyday life. (Common sense) It is easy to see that some human problems cannot be solved by mathematics. For example compare involvement and its counterpart,“If it rains, I take my umbrella.”“If I don’t take my umbrella, it doesn’t rain”Or the argued conjunction,“I don’t take my umbrella, so it doesn’t …

Algorithms – Chapter 3

The conditions A program does not always run sequentially. Normally it makes a decision at some point to execute only part of itself. Programming languages provide instructions on how to make these choices. Among these instructions we have conditional instructions. Conditional instruction (simple) Alternative (conditional) instruction Flowcharts were one of the important tools for writing …

Algorithms – Chapter 2

Getting started in C Getting started with a program in the C programming language and the different phases of program development. Here is a minimal program in C. Example: The different phases of program development We write/edit the source code with a text editor (such as notepad, emacs ,vi, gedit, kate, etc…) and then the …

Algorithms – Chapter 1

Instead of using a programming language to express an algorithm you can use natural language first (In this case English) and then as a second step use a programming language. But, before starting to study the operations or functions that constitute code perhaps we should recall the definition of an object in general. According to …