Low-frequency longitudinal oscillations of a flaring coronal loop are studied numerically. In the recent work of Nakariakov et al., Astron. and Astrophys., 414, L25-L28 (2004) it has been shown that the time dependences of density and velocity in a flaring loop contain well-pronounced quasi-harmonic oscillations associated with a 2nd harmonic of a standing slow magnetoacoustic wave. In this work we investigate physical nature of these oscillations in greater detail, namely, we study their spectrum (using periodogram technique) and how does heat positioning affects the mode excitation. We found that excitation of such oscillations practically independent of the positioning of the heat deposition in the loop. Because of the change of the background temperature and density, the phase shift between the density and velocity perturbations is not exactly equal to the quarter of the period, it varies along the loop and is time dependent, especially in the case of one footpoint (asymmetric) heating. KEYWORDS -- Sun: flares -- Sun: oscillations -- Sun: Corona -- Stars: flare -- Stars: oscillations -- Stars: coronae