WeixiangYan/CodeTransOcean huggingface dataset:
Task: Leap year



C#: using System;

class Program
{
    static void Main()
    {
        foreach (var year in new[] { 1900, 1994, 1996, DateTime.Now.Year })
        {
            Console.WriteLine("{0} is {1}a leap year.",
                              year,
                              DateTime.IsLeapYear(year) ? string.Empty : "not ");
        }
    }
}









Ada: 

function Is_Leap_Year (Year : Integer) return Boolean is
begin
   if Year rem 100 = 0 then
      return Year rem 400 = 0;
   else
      return Year rem 4 = 0;
   end if;
end Is_Leap_Year;















 
function Is_Leap_Year (Year : Integer) return Boolean is
begin
   return (Year rem 4 = 0) and then ((Year rem 16 = 0) or else (Year rem 100 /= 0));
end Is_Leap_Year;




pragma Inline (Is_Leap_Year);
Task: Leap year

C: #include <stdio.h>

int is_leap_year(unsigned year)
{
    return !(year & (year % 100 ? 3 : 15));
}

int main(void)
{
    const unsigned test_case[] = {
        1900, 1994, 1996, 1997, 2000, 2024, 2025, 2026, 2100
    };
    const unsigned n = sizeof test_case / sizeof test_case[0];

    for (unsigned i = 0; i != n; ++i) {
        unsigned year = test_case[i];
        printf("%u is %sa leap year.\n", year, is_leap_year(year) ? "" : "not ");
    }
    return 0;
}











Ada: 

function Is_Leap_Year (Year : Integer) return Boolean is
begin
   if Year rem 100 = 0 then
      return Year rem 400 = 0;
   else
      return Year rem 4 = 0;
   end if;
end Is_Leap_Year;















 
function Is_Leap_Year (Year : Integer) return Boolean is
begin
   return (Year rem 4 = 0) and then ((Year rem 16 = 0) or else (Year rem 100 /= 0));
end Is_Leap_Year;




pragma Inline (Is_Leap_Year);
Task: Leap year


C++: #include <iostream>

bool is_leap_year(int year) {
  return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
}

int main() {
  for (auto year : {1900, 1994, 1996, 1997, 2000}) {
    std::cout << year << (is_leap_year(year) ? " is" : " is not") << " a leap year.\n";
  }
}










Ada: 

function Is_Leap_Year (Year : Integer) return Boolean is
begin
   if Year rem 100 = 0 then
      return Year rem 400 = 0;
   else
      return Year rem 4 = 0;
   end if;
end Is_Leap_Year;















 
function Is_Leap_Year (Year : Integer) return Boolean is
begin
   return (Year rem 4 = 0) and then ((Year rem 16 = 0) or else (Year rem 100 /= 0));
end Is_Leap_Year;




pragma Inline (Is_Leap_Year);
Task: Leap year




Go: func isLeap(year int) bool {
    return year%400 == 0 || year%4 == 0 && year%100 != 0
}








Ada: 

function Is_Leap_Year (Year : Integer) return Boolean is
begin
   if Year rem 100 = 0 then
      return Year rem 400 = 0;
   else
      return Year rem 4 = 0;
   end if;
end Is_Leap_Year;















 
function Is_Leap_Year (Year : Integer) return Boolean is
begin
   return (Year rem 4 = 0) and then ((Year rem 16 = 0) or else (Year rem 100 /= 0));
end Is_Leap_Year;




pragma Inline (Is_Leap_Year);
Task: Leap year





Java: import java.util.GregorianCalendar;
import java.text.MessageFormat;

public class Leapyear{
        public static void main(String[] argv){
                int[] yrs = {1800,1900,1994,1998,1999,2000,2001,2004,2100};
                GregorianCalendar cal = new GregorianCalendar();
                for(int year : yrs){
                        System.err.println(MessageFormat.format("The year {0,number,#} is leaper: {1} / {2}.",
                                                                 year, cal.isLeapYear(year), isLeapYear(year)));
                }

        }
        public static boolean isLeapYear(int year){
                return (year % 100 == 0) ? (year % 400 == 0) : (year % 4 == 0);
        }
}







Ada: 

function Is_Leap_Year (Year : Integer) return Boolean is
begin
   if Year rem 100 = 0 then
      return Year rem 400 = 0;
   else
      return Year rem 4 = 0;
   end if;
end Is_Leap_Year;















 
function Is_Leap_Year (Year : Integer) return Boolean is
begin
   return (Year rem 4 = 0) and then ((Year rem 16 = 0) or else (Year rem 100 /= 0));
end Is_Leap_Year;




pragma Inline (Is_Leap_Year);
Task: Leap year







Python: import calendar
calendar.isleap(year)





Ada: 

function Is_Leap_Year (Year : Integer) return Boolean is
begin
   if Year rem 100 = 0 then
      return Year rem 400 = 0;
   else
      return Year rem 4 = 0;
   end if;
end Is_Leap_Year;















 
function Is_Leap_Year (Year : Integer) return Boolean is
begin
   return (Year rem 4 = 0) and then ((Year rem 16 = 0) or else (Year rem 100 /= 0));
end Is_Leap_Year;




pragma Inline (Is_Leap_Year);
Task: Leap year








VB: Public Function Leap_year(year As Integer) As Boolean
    Leap_year = (Month(DateSerial(year, 2, 29)) = 2)
End Function




Ada: 

function Is_Leap_Year (Year : Integer) return Boolean is
begin
   if Year rem 100 = 0 then
      return Year rem 400 = 0;
   else
      return Year rem 4 = 0;
   end if;
end Is_Leap_Year;















 
function Is_Leap_Year (Year : Integer) return Boolean is
begin
   return (Year rem 4 = 0) and then ((Year rem 16 = 0) or else (Year rem 100 /= 0));
end Is_Leap_Year;




pragma Inline (Is_Leap_Year);
Task: Leap year

C: #include <stdio.h>

int is_leap_year(unsigned year)
{
    return !(year & (year % 100 ? 3 : 15));
}

int main(void)
{
    const unsigned test_case[] = {
        1900, 1994, 1996, 1997, 2000, 2024, 2025, 2026, 2100
    };
    const unsigned n = sizeof test_case / sizeof test_case[0];

    for (unsigned i = 0; i != n; ++i) {
        unsigned year = test_case[i];
        printf("%u is %sa leap year.\n", year, is_leap_year(year) ? "" : "not ");
    }
    return 0;
}
Task: Leap year



C#: using System;

class Program
{
    static void Main()
    {
        foreach (var year in new[] { 1900, 1994, 1996, DateTime.Now.Year })
        {
            Console.WriteLine("{0} is {1}a leap year.",
                              year,
                              DateTime.IsLeapYear(year) ? string.Empty : "not ");
        }
    }
}
Task: Leap year


C++: #include <iostream>

bool is_leap_year(int year) {
  return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
}

int main() {
  for (auto year : {1900, 1994, 1996, 1997, 2000}) {
    std::cout << year << (is_leap_year(year) ? " is" : " is not") << " a leap year.\n";
  }
}
Task: Leap year





Java: import java.util.GregorianCalendar;
import java.text.MessageFormat;

public class Leapyear{
        public static void main(String[] argv){
                int[] yrs = {1800,1900,1994,1998,1999,2000,2001,2004,2100};
                GregorianCalendar cal = new GregorianCalendar();
                for(int year : yrs){
                        System.err.println(MessageFormat.format("The year {0,number,#} is leaper: {1} / {2}.",
                                                                 year, cal.isLeapYear(year), isLeapYear(year)));
                }

        }
        public static boolean isLeapYear(int year){
                return (year % 100 == 0) ? (year % 400 == 0) : (year % 4 == 0);
        }
}
Task: Leap year







Python: import calendar
calendar.isleap(year)
Task: Leap year








VB: Public Function Leap_year(year As Integer) As Boolean
    Leap_year = (Month(DateSerial(year, 2, 29)) = 2)
End Function
Task: Leap year




Go: func isLeap(year int) bool {
    return year%400 == 0 || year%4 == 0 && year%100 != 0
}
Task: Leap year



C#: using System;

class Program
{
    static void Main()
    {
        foreach (var year in new[] { 1900, 1994, 1996, DateTime.Now.Year })
        {
            Console.WriteLine("{0} is {1}a leap year.",
                              year,
                              DateTime.IsLeapYear(year) ? string.Empty : "not ");
        }
    }
}








Fortran: program leap
 implicit none

 write(*,*) leap_year([1900, 1996, 1997, 2000])

 contains

	pure elemental function leap_year(y) result(is_leap)
	implicit none
	logical :: is_leap
	integer,intent(in) :: y	
	
	is_leap = (mod(y,4)==0 .and. .not. mod(y,100)==0) .or. (mod(y,400)==0)	
	
	end function leap_year
	
end program leap
Task: Leap year


C++: #include <iostream>

bool is_leap_year(int year) {
  return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
}

int main() {
  for (auto year : {1900, 1994, 1996, 1997, 2000}) {
    std::cout << year << (is_leap_year(year) ? " is" : " is not") << " a leap year.\n";
  }
}









Fortran: program leap
 implicit none

 write(*,*) leap_year([1900, 1996, 1997, 2000])

 contains

	pure elemental function leap_year(y) result(is_leap)
	implicit none
	logical :: is_leap
	integer,intent(in) :: y	
	
	is_leap = (mod(y,4)==0 .and. .not. mod(y,100)==0) .or. (mod(y,400)==0)	
	
	end function leap_year
	
end program leap
Task: Leap year

C: #include <stdio.h>

int is_leap_year(unsigned year)
{
    return !(year & (year % 100 ? 3 : 15));
}

int main(void)
{
    const unsigned test_case[] = {
        1900, 1994, 1996, 1997, 2000, 2024, 2025, 2026, 2100
    };
    const unsigned n = sizeof test_case / sizeof test_case[0];

    for (unsigned i = 0; i != n; ++i) {
        unsigned year = test_case[i];
        printf("%u is %sa leap year.\n", year, is_leap_year(year) ? "" : "not ");
    }
    return 0;
}










Fortran: program leap
 implicit none

 write(*,*) leap_year([1900, 1996, 1997, 2000])

 contains

	pure elemental function leap_year(y) result(is_leap)
	implicit none
	logical :: is_leap
	integer,intent(in) :: y	
	
	is_leap = (mod(y,4)==0 .and. .not. mod(y,100)==0) .or. (mod(y,400)==0)	
	
	end function leap_year
	
end program leap
Task: Leap year





Java: import java.util.GregorianCalendar;
import java.text.MessageFormat;

public class Leapyear{
        public static void main(String[] argv){
                int[] yrs = {1800,1900,1994,1998,1999,2000,2001,2004,2100};
                GregorianCalendar cal = new GregorianCalendar();
                for(int year : yrs){
                        System.err.println(MessageFormat.format("The year {0,number,#} is leaper: {1} / {2}.",
                                                                 year, cal.isLeapYear(year), isLeapYear(year)));
                }

        }
        public static boolean isLeapYear(int year){
                return (year % 100 == 0) ? (year % 400 == 0) : (year % 4 == 0);
        }
}






Fortran: program leap
 implicit none

 write(*,*) leap_year([1900, 1996, 1997, 2000])

 contains

	pure elemental function leap_year(y) result(is_leap)
	implicit none
	logical :: is_leap
	integer,intent(in) :: y	
	
	is_leap = (mod(y,4)==0 .and. .not. mod(y,100)==0) .or. (mod(y,400)==0)	
	
	end function leap_year
	
end program leap
Task: Leap year







Python: import calendar
calendar.isleap(year)




Fortran: program leap
 implicit none

 write(*,*) leap_year([1900, 1996, 1997, 2000])

 contains

	pure elemental function leap_year(y) result(is_leap)
	implicit none
	logical :: is_leap
	integer,intent(in) :: y	
	
	is_leap = (mod(y,4)==0 .and. .not. mod(y,100)==0) .or. (mod(y,400)==0)	
	
	end function leap_year
	
end program leap
Task: Leap year








VB: Public Function Leap_year(year As Integer) As Boolean
    Leap_year = (Month(DateSerial(year, 2, 29)) = 2)
End Function



Fortran: program leap
 implicit none

 write(*,*) leap_year([1900, 1996, 1997, 2000])

 contains

	pure elemental function leap_year(y) result(is_leap)
	implicit none
	logical :: is_leap
	integer,intent(in) :: y	
	
	is_leap = (mod(y,4)==0 .and. .not. mod(y,100)==0) .or. (mod(y,400)==0)	
	
	end function leap_year
	
end program leap
Task: Leap year






PHP: <?php
function isLeapYear($year) {
    if ($year % 100 == 0) {
        return ($year % 400 == 0);
    }
    return ($year % 4 == 0);
}





Fortran: program leap
 implicit none

 write(*,*) leap_year([1900, 1996, 1997, 2000])

 contains

	pure elemental function leap_year(y) result(is_leap)
	implicit none
	logical :: is_leap
	integer,intent(in) :: y	
	
	is_leap = (mod(y,4)==0 .and. .not. mod(y,100)==0) .or. (mod(y,400)==0)	
	
	end function leap_year
	
end program leap
Task: Leap year

C: #include <stdio.h>

int is_leap_year(unsigned year)
{
    return !(year & (year % 100 ? 3 : 15));
}

int main(void)
{
    const unsigned test_case[] = {
        1900, 1994, 1996, 1997, 2000, 2024, 2025, 2026, 2100
    };
    const unsigned n = sizeof test_case / sizeof test_case[0];

    for (unsigned i = 0; i != n; ++i) {
        unsigned year = test_case[i];
        printf("%u is %sa leap year.\n", year, is_leap_year(year) ? "" : "not ");
    }
    return 0;
}









COBOL:        IDENTIFICATION DIVISION.
       PROGRAM-ID. leap-year.

       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  examples VALUE "19001994199619972000".
           03  year PIC 9(4) OCCURS 5 TIMES
               INDEXED BY year-index.

       01  remainders.
           03 400-rem   PIC 9(4).
           03 100-rem   PIC 9(4).
           03 4-rem     PIC 9(4).

       PROCEDURE DIVISION.
           PERFORM VARYING year-index FROM 1 BY 1 UNTIL 5 < year-index
               MOVE FUNCTION MOD(year (year-index), 400) TO 400-rem
               MOVE FUNCTION MOD(year (year-index), 100) TO 100-rem
               MOVE FUNCTION MOD(year (year-index), 4) TO 4-rem

               IF 400-rem = 0 OR ((100-rem NOT = 0) AND 4-rem = 0)
                   DISPLAY year (year-index) " is a leap year."
               ELSE
                   DISPLAY year (year-index) " is not a leap year."
               END-IF
           END-PERFORM

           GOBACK
           .
Task: Leap year



C#: using System;

class Program
{
    static void Main()
    {
        foreach (var year in new[] { 1900, 1994, 1996, DateTime.Now.Year })
        {
            Console.WriteLine("{0} is {1}a leap year.",
                              year,
                              DateTime.IsLeapYear(year) ? string.Empty : "not ");
        }
    }
}







COBOL:        IDENTIFICATION DIVISION.
       PROGRAM-ID. leap-year.

       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  examples VALUE "19001994199619972000".
           03  year PIC 9(4) OCCURS 5 TIMES
               INDEXED BY year-index.

       01  remainders.
           03 400-rem   PIC 9(4).
           03 100-rem   PIC 9(4).
           03 4-rem     PIC 9(4).

       PROCEDURE DIVISION.
           PERFORM VARYING year-index FROM 1 BY 1 UNTIL 5 < year-index
               MOVE FUNCTION MOD(year (year-index), 400) TO 400-rem
               MOVE FUNCTION MOD(year (year-index), 100) TO 100-rem
               MOVE FUNCTION MOD(year (year-index), 4) TO 4-rem

               IF 400-rem = 0 OR ((100-rem NOT = 0) AND 4-rem = 0)
                   DISPLAY year (year-index) " is a leap year."
               ELSE
                   DISPLAY year (year-index) " is not a leap year."
               END-IF
           END-PERFORM

           GOBACK
           .
Task: Leap year


C++: #include <iostream>

bool is_leap_year(int year) {
  return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
}

int main() {
  for (auto year : {1900, 1994, 1996, 1997, 2000}) {
    std::cout << year << (is_leap_year(year) ? " is" : " is not") << " a leap year.\n";
  }
}








COBOL:        IDENTIFICATION DIVISION.
       PROGRAM-ID. leap-year.

       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  examples VALUE "19001994199619972000".
           03  year PIC 9(4) OCCURS 5 TIMES
               INDEXED BY year-index.

       01  remainders.
           03 400-rem   PIC 9(4).
           03 100-rem   PIC 9(4).
           03 4-rem     PIC 9(4).

       PROCEDURE DIVISION.
           PERFORM VARYING year-index FROM 1 BY 1 UNTIL 5 < year-index
               MOVE FUNCTION MOD(year (year-index), 400) TO 400-rem
               MOVE FUNCTION MOD(year (year-index), 100) TO 100-rem
               MOVE FUNCTION MOD(year (year-index), 4) TO 4-rem

               IF 400-rem = 0 OR ((100-rem NOT = 0) AND 4-rem = 0)
                   DISPLAY year (year-index) " is a leap year."
               ELSE
                   DISPLAY year (year-index) " is not a leap year."
               END-IF
           END-PERFORM

           GOBACK
           .
Task: Leap year





Java: import java.util.GregorianCalendar;
import java.text.MessageFormat;

public class Leapyear{
        public static void main(String[] argv){
                int[] yrs = {1800,1900,1994,1998,1999,2000,2001,2004,2100};
                GregorianCalendar cal = new GregorianCalendar();
                for(int year : yrs){
                        System.err.println(MessageFormat.format("The year {0,number,#} is leaper: {1} / {2}.",
                                                                 year, cal.isLeapYear(year), isLeapYear(year)));
                }

        }
        public static boolean isLeapYear(int year){
                return (year % 100 == 0) ? (year % 400 == 0) : (year % 4 == 0);
        }
}





COBOL:        IDENTIFICATION DIVISION.
       PROGRAM-ID. leap-year.

       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  examples VALUE "19001994199619972000".
           03  year PIC 9(4) OCCURS 5 TIMES
               INDEXED BY year-index.

       01  remainders.
           03 400-rem   PIC 9(4).
           03 100-rem   PIC 9(4).
           03 4-rem     PIC 9(4).

       PROCEDURE DIVISION.
           PERFORM VARYING year-index FROM 1 BY 1 UNTIL 5 < year-index
               MOVE FUNCTION MOD(year (year-index), 400) TO 400-rem
               MOVE FUNCTION MOD(year (year-index), 100) TO 100-rem
               MOVE FUNCTION MOD(year (year-index), 4) TO 4-rem

               IF 400-rem = 0 OR ((100-rem NOT = 0) AND 4-rem = 0)
                   DISPLAY year (year-index) " is a leap year."
               ELSE
                   DISPLAY year (year-index) " is not a leap year."
               END-IF
           END-PERFORM

           GOBACK
           .
Task: Leap year







Python: import calendar
calendar.isleap(year)



COBOL:        IDENTIFICATION DIVISION.
       PROGRAM-ID. leap-year.

       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  examples VALUE "19001994199619972000".
           03  year PIC 9(4) OCCURS 5 TIMES
               INDEXED BY year-index.

       01  remainders.
           03 400-rem   PIC 9(4).
           03 100-rem   PIC 9(4).
           03 4-rem     PIC 9(4).

       PROCEDURE DIVISION.
           PERFORM VARYING year-index FROM 1 BY 1 UNTIL 5 < year-index
               MOVE FUNCTION MOD(year (year-index), 400) TO 400-rem
               MOVE FUNCTION MOD(year (year-index), 100) TO 100-rem
               MOVE FUNCTION MOD(year (year-index), 4) TO 4-rem

               IF 400-rem = 0 OR ((100-rem NOT = 0) AND 4-rem = 0)
                   DISPLAY year (year-index) " is a leap year."
               ELSE
                   DISPLAY year (year-index) " is not a leap year."
               END-IF
           END-PERFORM

           GOBACK
           .
Task: Leap year








VB: Public Function Leap_year(year As Integer) As Boolean
    Leap_year = (Month(DateSerial(year, 2, 29)) = 2)
End Function


COBOL:        IDENTIFICATION DIVISION.
       PROGRAM-ID. leap-year.

       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  examples VALUE "19001994199619972000".
           03  year PIC 9(4) OCCURS 5 TIMES
               INDEXED BY year-index.

       01  remainders.
           03 400-rem   PIC 9(4).
           03 100-rem   PIC 9(4).
           03 4-rem     PIC 9(4).

       PROCEDURE DIVISION.
           PERFORM VARYING year-index FROM 1 BY 1 UNTIL 5 < year-index
               MOVE FUNCTION MOD(year (year-index), 400) TO 400-rem
               MOVE FUNCTION MOD(year (year-index), 100) TO 100-rem
               MOVE FUNCTION MOD(year (year-index), 4) TO 4-rem

               IF 400-rem = 0 OR ((100-rem NOT = 0) AND 4-rem = 0)
                   DISPLAY year (year-index) " is a leap year."
               ELSE
                   DISPLAY year (year-index) " is not a leap year."
               END-IF
           END-PERFORM

           GOBACK
           .
Task: Leap year




Go: func isLeap(year int) bool {
    return year%400 == 0 || year%4 == 0 && year%100 != 0
}






COBOL:        IDENTIFICATION DIVISION.
       PROGRAM-ID. leap-year.

       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  examples VALUE "19001994199619972000".
           03  year PIC 9(4) OCCURS 5 TIMES
               INDEXED BY year-index.

       01  remainders.
           03 400-rem   PIC 9(4).
           03 100-rem   PIC 9(4).
           03 4-rem     PIC 9(4).

       PROCEDURE DIVISION.
           PERFORM VARYING year-index FROM 1 BY 1 UNTIL 5 < year-index
               MOVE FUNCTION MOD(year (year-index), 400) TO 400-rem
               MOVE FUNCTION MOD(year (year-index), 100) TO 100-rem
               MOVE FUNCTION MOD(year (year-index), 4) TO 4-rem

               IF 400-rem = 0 OR ((100-rem NOT = 0) AND 4-rem = 0)
                   DISPLAY year (year-index) " is a leap year."
               ELSE
                   DISPLAY year (year-index) " is not a leap year."
               END-IF
           END-PERFORM

           GOBACK
           .
Task: Leap year






PHP: <?php
function isLeapYear($year) {
    if ($year % 100 == 0) {
        return ($year % 400 == 0);
    }
    return ($year % 4 == 0);
}
Task: Leap year






PHP: <?php
function isLeapYear($year) {
    if ($year % 100 == 0) {
        return ($year % 400 == 0);
    }
    return ($year % 4 == 0);
}






Ada: 

function Is_Leap_Year (Year : Integer) return Boolean is
begin
   if Year rem 100 = 0 then
      return Year rem 400 = 0;
   else
      return Year rem 4 = 0;
   end if;
end Is_Leap_Year;















 
function Is_Leap_Year (Year : Integer) return Boolean is
begin
   return (Year rem 4 = 0) and then ((Year rem 16 = 0) or else (Year rem 100 /= 0));
end Is_Leap_Year;




pragma Inline (Is_Leap_Year);
Task: Leap year






PHP: <?php
function isLeapYear($year) {
    if ($year % 100 == 0) {
        return ($year % 400 == 0);
    }
    return ($year % 4 == 0);
}




COBOL:        IDENTIFICATION DIVISION.
       PROGRAM-ID. leap-year.

       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  examples VALUE "19001994199619972000".
           03  year PIC 9(4) OCCURS 5 TIMES
               INDEXED BY year-index.

       01  remainders.
           03 400-rem   PIC 9(4).
           03 100-rem   PIC 9(4).
           03 4-rem     PIC 9(4).

       PROCEDURE DIVISION.
           PERFORM VARYING year-index FROM 1 BY 1 UNTIL 5 < year-index
               MOVE FUNCTION MOD(year (year-index), 400) TO 400-rem
               MOVE FUNCTION MOD(year (year-index), 100) TO 100-rem
               MOVE FUNCTION MOD(year (year-index), 4) TO 4-rem

               IF 400-rem = 0 OR ((100-rem NOT = 0) AND 4-rem = 0)
                   DISPLAY year (year-index) " is a leap year."
               ELSE
                   DISPLAY year (year-index) " is not a leap year."
               END-IF
           END-PERFORM

           GOBACK
           .
Task: Program name



C#: using System;
namespace ProgramName
{
	class Program
	{
		static void Main(string[] args)
		{
			Console.Write(Environment.CommandLine);
		}
	}
}









Ada: with Ada.Command_Line, Ada.Text_IO;

procedure Command_Name is
begin
   Ada.Text_IO.Put_Line(Ada.Command_Line.Command_Name);
end Command_Name;
Task: Program name

C: #include <stdio.h>

int main(int argc, char **argv) {
	printf("Executable: %s\n", argv[0]);

	return 0;
}











Ada: with Ada.Command_Line, Ada.Text_IO;

procedure Command_Name is
begin
   Ada.Text_IO.Put_Line(Ada.Command_Line.Command_Name);
end Command_Name;
Task: Program name


C++: #include <iostream>

using namespace std;

int main(int argc, char **argv) {
	char *program = argv[0];
	cout << "Program: " << program << endl;
}










Ada: with Ada.Command_Line, Ada.Text_IO;

procedure Command_Name is
begin
   Ada.Text_IO.Put_Line(Ada.Command_Line.Command_Name);
end Command_Name;
Task: Program name




Go: package main

import (
    "fmt"
    "os"
)

func main() {
    fmt.Println("Program:", os.Args[0])
}








Ada: with Ada.Command_Line, Ada.Text_IO;

procedure Command_Name is
begin
   Ada.Text_IO.Put_Line(Ada.Command_Line.Command_Name);
end Command_Name;