checks if the sum of 3 integers is an even integer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int32), | intent(in) | :: | x |
variables to check if the sum is even |
||
integer(kind=int32), | intent(in) | :: | y |
variables to check if the sum is even |
||
integer(kind=int32), | intent(in) | :: | z |
variables to check if the sum is even |
(out) result: true/false
function is_sum_even(x, y, z) result(sum_even)
!! checks if the sum of 3 integers is an even integer
!---------------------------------------------------------------------!
integer(int32), intent(in) :: x, y, z
!! variables to check if the sum is even
logical :: sum_even
!! (out) result: true/false
!---------------------------------------------------------------------!
sum_even = (modulo(x + y + z, 2) == 0)
!---------------------------------------------------------------------!
end function is_sum_even