How to resolve the algorithm Leap year step by step in the PL/I programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Leap year step by step in the PL/I programming language

Table of Contents

Problem Statement

Determine whether a given year is a leap year in the Gregorian calendar.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Leap year step by step in the PL/I programming language

Source code in the pl/i programming language

dcl mod  builtin;
dcl year fixed bin (31);

do year = 1900, 1996 to 2001;
  if mod(year, 4)    = 0 &
    (mod(year, 100) ^= 0 |
     mod(year, 400)  = 0) then
    put skip edit(year, 'is a leap year') (p'9999b', a);
  else
    put skip edit(year, 'is not a leap year') (p'9999b', a);
end;

  

You may also check:How to resolve the algorithm Classes step by step in the Visual Basic .NET programming language
You may also check:How to resolve the algorithm Repunit primes step by step in the Phix programming language
You may also check:How to resolve the algorithm Repeat a string step by step in the Retro programming language
You may also check:How to resolve the algorithm Ray-casting algorithm step by step in the Go programming language
You may also check:How to resolve the algorithm Man or boy test step by step in the Wren programming language