A Monte Carlo code named Mcnaff has been developed and tested for flow rate measurement and general composition determination of a flowing fluid by neutron activation analysis. Specifically, oxygen determination in a flowing fluid is treated, including simulating the emission and transport of neutrons in the fluid, the activation of l6O to 16N, the subsequent flow and dispersion of the 16N in the flow channel, the downstream decay of 16N, and the subsequent detection of the emitted decay gamma rays. This code is very efficient, partly because (a) the continuous single history approach has been taken, which follows a single history from emission of a neutron, through the production and decay of the 16N and the emission of a characteristic gamma ray, and finally to the full energy detection of the gamma ray and (b) the principle of forcing can be and is used throughout so that almost every history results in a partial success. The present Mcnaff code is capable of calculating gamma-ray detection yields per neutron emitted to the same accuracy as an approach by Perez-Griffo, Block, and La hey, which numerically solves the partial differential equations for modeling particle dispersion and diffusion and calculates separately by Monte Carlo both the neutron absorption and gamma-ray detection process. The Mcnaff code is estimated to be about two orders of magnitude faster and should be more convenient to use because all calculations are accomplished in a single step.