Skip to main content

Program to test whether a number is even or odd

C      Program to test whether a number is even or odd
        write(*,*)'Input the number:'
        read(*,*)n
        if (mod(n,2).eq.0)then
        write(*,*)'The number is Even.'
        else
        write(*,*)'The number is odd.'
        end if
        end
       

Comments