I solved differential equations in c++ using euler method. In output i got only few values after that it is giving nan values. Is there any problem in the code or method can't solve those stiff equations.
I am not an expert, but it sounds like a method problem to me or probably something wrong when coding your algorithm. Maybe this paper can help you: http://www.lehman.edu/academics/cmacs/documents/NumericalIntegrationTutorial.pdf
Euler method is the simpliest method for solving differential equations. But it isn't clear how to help you without more information. Of course this can be because of mistake coding or maybe you are calculating with big iteration step. What kind of diffenertial equations you solve? What kind of boundary conditions you use?
There are many C++ libraries that already provide implemented algorithms to resolve ordinary differential equations among which odeint (see link 1 and 2).
You can find other numerical libraries for C++ at the link 3.
Other sources on the application of Euler method to solve differential equations in link 4 and 5.