To conduct accurate air fuel ratio control by compensating the change of output characteristic of a wide area air fuel ratio sensor caused by the change of exhaust gas properties with the change of an exhaust passage by an air fuel ratio map corresponding to a selected exhaust passage to properly detect the actual air fuel ratio.
When an exhaust passage (first exhaust pipe 16a or a second exhaust pipe 16b) for communicating an exhaust port 2b with a catalyst converter 17 is selectively switched according to the engine operating condition, the distance of the exhaust passage from the exhaust port 2b to a wide area air fuel ratio sensor 25 is changed with the change of the exhaust passage. With the above change, the properties of exhaust gas are changed so that the output value of the wide area air fuel ratio sensor 25 to the actual air fuel ratio is changed and the output characteristic of the wide area air fuel ratio sensor 25 is changed. Therefore, according to the output characteristic of the wide area air fuel ratio sensor 25 when exhaust gas passes through the corresponding exhaust passage, the accurate actual air fuel ratio obtained by an experiment is stored in each air fuel ratio map.