The presence of electron releasing groups (ERG) reduces the acidic strength of the compound through the inductive effect. Contrarily, the electron withdrawing group' (EWG) increases the acidic strength of a compound. The methoxy group is ERG, while the nitro group is EWG. So, increasing number of EWG will increase the acidity. Thus, the increasing order of acid strength will be 4-methoxybenzoic acid < benzoicacid < 4-nitrobenzoic acid <3,4-dinitrobenzoic acid.