The variable 'F' is being used without being initialized.help!?
this is the program i am trying to write.
it has no aparant problem except the error stated above about the third line from the bottom.
i have initalized F in the for loop and it printed it out fine.
what is my problem?!?!
please heeelp
p.s.i can't use an int in the for loop becasue exp needs a double!!!
#include <iostream>
#include <conio.h>
#include <math.h>
usingnamespace std;
int main()
{ int n,l,k;
double a,b,f,f1,g,i,h;
double F[100];
cout <<" This program calculates the integral of e^x by using a variation of the simpson rule."<< endl;
cout<< "Please entet the integral's lower bond:"<< endl;
cin>> a;
cout<< "Enter the integral's upper bond:"<< endl;
cin>> b;
cout << "Enter the desired number of partitions:" << endl;
cin>> n;
cout<< "The length of each partiton is:"<<endl;
h=(a+b)/n;
cout<< h << endl;
for (i=a; i<=b; i=i+h)
{ f=exp(i);
F[k]=f;
cout<< F[k]<<endl;}
cout<< F[0];
getch();
return 0;
}