Skip to main content
Top

1988 | OriginalPaper | Chapter

A First Example

Author : Professor Niklaus Wirth

Published in: Programming in Modula-2

Publisher: Springer Berlin Heidelberg

Activate our intelligent search to find suitable subject content or patents.

search-config
loading …

Let us follow the steps of development of a simple program and thereby explain some of the fundamental concepts of programming and of the basic facilities of Modula. The task shall be, given two natural numbers x and y, to compute their greatest common divisor (gcd). The mathematical knowledge needed for this problem is the following: 1.if x equals y, x (or y) is the desired result2.the gcd of two numbers remains unchanged, if we replace the larger number by the difference of the numbers, i.e. subtract the smaller number form the larger one.

Metadata
Title
A First Example
Author
Professor Niklaus Wirth
Copyright Year
1988
Publisher
Springer Berlin Heidelberg
DOI
https://doi.org/10.1007/978-3-642-83565-0_2

Premium Partner