Large inaccuracies exist in the car speed forecast due to the driver actions, the vehicle, and r2016oad conditions, which are not known a priori. Hence, real time scheduling using optimization methods is not feasible in general. So, an energy management system based on artificial neural network looking one step ahead is presented to minimize the cost of hydrogen and battery degradation. The optimum results of dynamic programming are used to provide a data set used to train an artificial neural network offline which would help solve the problem of real-time implementation. The inputs of the artificial neural network are fuel cell power, the battery state of charge, and the demand forecast; whereas, the output is the fuel cell power. The results obtained by the artificial neural network are compared to those obtained by dynamic programming and found to be very close. The artificial neural network is trained using the standard Urban Dynamometer Driving Schedule, and is able to provide charge sustaining and charge depletion operations. It is also tested on ten percent faster and ten percent slower variations of the same cycle, as well as on the Highway Fuel Economy Test Cycle and New European Driving cycle. The tests show a very good generalization capability of the developed artificial neural network on the different drive cycles.