Mode:
Duration:
1
2
3
4
5
6
7
8
9
# modula2/demo.m2
MODULE Counter;
IMPORT InOut;
BEGIN
FOR i := 1 TO 5 DO
InOut.WriteInt(i, 0);
InOut.WriteLn;
END;
END Counter.Coding works best on desktop or with an external keyboard.
# modula2/demo.m2
MODULE Counter;
IMPORT InOut;
BEGIN
FOR i := 1 TO 5 DO
InOut.WriteInt(i, 0);
InOut.WriteLn;
END;
END Counter.Coding works best on desktop or with an external keyboard.
A simple Modula-2 program printing numbers 1 to 5.
# modula2/demo.m2
MODULE Counter;
IMPORT InOut;
BEGIN
FOR i := 1 TO 5 DO
InOut.WriteInt(i, 0);
InOut.WriteLn;
END;
END Counter.Modula is a procedural programming language and modular systems language designed by Niklaus Wirth. It emphasizes strong typing, modularity, and simplicity, supporting the development of reliable, maintainable software systems.
Origin & Creator
Modula was created by Niklaus Wirth in 1975 at ETH Zurich as a successor to Pascal with modular programming support.
Industrial Note
Modula is preferred in contexts where strong type safety, modular design, and structured programming are valued, particularly in education and system programming.