Consider that the total number of students is x.
The number of girls is given as 540, then the number of boys will be x−540.
Since 70% of the students are boys, then the remaining 30% are girls.
So,
30% of x=540
⇒30x100=540
⇒x=540×10030
∴x=1800
Therefore, the total number of students is 1800.
Thus, the total number of boys is 1800−540=1260.