I'm having trouble with a problem. The problem asks that I use the sinx/x function and produce a table of values for the function on a user entered interval. I'm just starting out with C++ and having a hard time with this so any help would be greatly appreciated. Here's what I have so far:
#include <iostream>
#include <cmath>
using namespace std;
double sinc(const double x)
int main()
{
{
if (x==0)
return 1;
return sin(x)/x;
}
double a,b
cout<<"Enter the values for the interval with"<<"\na = starting value"<<"\nb = ending value"<<endl;
cout<<"a = "
cin>>a>>endl;
cout<<"b = "
cin>>b>>endl;
do sinc(x);
for (x = a; x<= b; x ++)
cout<<"_____________________________________";
cout<<"\n "<< a << " "<< sinc(a)
}
What I want to do is have the data displayed in a table with values of x displayed on corresponding line with function value at the x value