The main thrust of the article is to provide interesting example, useful for students of using bitwise operations in the programming languages C ++ and Java. As an example, we describe an algorithm for obtaining a Latin square of arbitrary order. We will outline some techniques for the use of bitwise operations.