DataMuseum.dk

Presents historical artifacts from the history of:

CP/M

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about CP/M

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦59e8d78a5⟧ TextFile

    Length: 512 (0x200)
    Types: TextFile
    Names: »SFD.PAS«

Derivation

└─⟦09235ab48⟧ Bits:30003065 Demoprogrammer K-Z til Pascal bog
    └─ ⟦this⟧ »SFD.PAS« 
└─⟦092727b26⟧ Bits:30005927 Demoprogrammer til Pascal bog (Jet-80)
    └─ ⟦this⟧ »SFD.PAS« 

TextFile

PROGRAM sfd;
  
  VAR
    tal1, tal2 : INTEGER;
  
  FUNCTION faelles(n, m : INTEGER) : INTEGER;
    
    BEGIN (* faelles *)
      IF m = 0
        THEN faelles := n
        ELSE faelles := faelles(m, n MOD m);
    END; (* faelles *)
  
  BEGIN (* sfd *)
    WRITE(CLRHOM);
    WRITE('Indtast 1. tal : '); READLN(tal1);
    WRITE('Indtast 2. tal : '); READLN(tal2);
    WRITELN('Største fælles divisor for ', tal1, ' og ', tal2, ' er ',
            faelles(tal1, tal2));
  END. (* sfd *)
«eof»