I'm trying to get some calculation but when x equal zero it output some strange number. What might the problem be?
 #include <iostream> 
    #include <math.h>  
    using namespace std;
    void main() 
    { 
        const int N = 100;  
        int i;  
        double x, h, a = -1.0, b = 1.0, y[N+1];  
        h = (b - a)/N; //h=0.02
        for (i = 0, x = a; i <= N; i++, x += h)  
        { 
            if (x == 0) // When x is 0
            {
                cout << x << '\t' << "0.00" << endl;
                continue;
            }
            y[i] = exp(-x*x);  
            cout << x << '\t' << y[i] << endl; 
        }
    }
 
     
    