How to resolve the algorithm Square but not cube step by step in the 11l programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Square but not cube step by step in the 11l programming language

Table of Contents

Problem Statement

Show the first   30   positive integers which are squares but not cubes of such integers. Optionally, show also the first   3   positive integers which are both squares and cubes,   and mark them as such.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Square but not cube step by step in the 11l programming language

Source code in the 11l programming language

V n = 1
V count = 0

L count < 30
   V sq = n * n
   V cr = Int(sq ^ (1/3) + 1e-6)
   I cr * cr * cr != sq
      count++
      print(sq)
   E
      print(sq‘ is square and cube’)
   n++

  

You may also check:How to resolve the algorithm Zeckendorf arithmetic step by step in the Visual Basic .NET programming language
You may also check:How to resolve the algorithm Abbreviations, simple step by step in the D programming language
You may also check:How to resolve the algorithm Matrix multiplication step by step in the Ada programming language
You may also check:How to resolve the algorithm Define a primitive data type step by step in the E programming language
You may also check:How to resolve the algorithm Operator precedence step by step in the C programming language