program BitOperations
  implicit none
  integer::I,J,K
  I=4
  J=IBSET(I,5)
  print*,"J=",J
  K=IBCLR(J,2)
  print*,'K=',K
  print*, 'Bit 2 of K is',BTEST(K,2)
  print*, 'Bit 5 of K is',BTEST(K,5)
  print*,"I",I
  I=IBSET(IBCLR(I,2),1)
  print*,"I",I
end program BitOperations
