Yes, the complete bipartite graph K(m,n) has mn edges, and it is easy to show that for fixed m+n that this is maximised when m and n are as close to equal as possible. However, not every graph without triangles is bipartite. As a counterexample consider the 5-cycle.