Rectangular cross-sections of reinforced concrete beams and columns with nonsymmetric reinforcement are considered in the paper. The objective function represents the total cost of concrete, steel and formwork. Several dimensional and behavioral constraints (bearing capacity, cracking, deflection) are allowed for. The problem was formulated in general form so that introduction of specific regulations following from national codes is possible. The computer program for optimal design of beams and frames loaded in-plane has been developed. The numerical examples were computed taking into account the rules of Polish Design Code.