How to resolve the algorithm Largest proper divisor of n step by step in the BCPL programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Largest proper divisor of n step by step in the BCPL programming language

Table of Contents

Problem Statement

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Largest proper divisor of n step by step in the BCPL programming language

Source code in the bcpl programming language

get "libhdr"

let lpd(n) = valof
    for i = n<=1 -> 1, n-1 to 1 by -1
        if n rem i=0 resultis i

let start() be
    for i=1 to 100
    $(  writed(lpd(i), 3)
        if i rem 10=0 then wrch('*N')
    $)

  

You may also check:How to resolve the algorithm Generic swap step by step in the Java programming language
You may also check:How to resolve the algorithm Wireworld step by step in the Rust programming language
You may also check:How to resolve the algorithm Colour pinstripe/Display step by step in the True BASIC programming language
You may also check:How to resolve the algorithm Largest proper divisor of n step by step in the Lua programming language
You may also check:How to resolve the algorithm Sum multiples of 3 and 5 step by step in the Prolog programming language