Hey Guys how's it going. I need help with arrays. I need to store all sine values from 0 - 90 into an array. So I made an array the size of 200 since the sine values would only reach 180. But I do not know how to make the user input an angle and have the program call into the array and look for that angle and display the results. I've looked online and cant seem to find how to do this. It just shows how to display all the information which I do not need to do.
#include <iostream>
#include <math.h>
usingnamespace std;
int main ()
{
double a;
double data [200];
double pi = acos(-1.0);
cout << "Enter the angle to recive the sine value:\n";
cin >> a;
double x[200];
for(int i = 0; i<=90; i++)
{
double x = i * pi / 180;
double y =sin(x);
cin >> data [i];
cout << i << "\t" << y << "\n";
}
system("pause");
return 0;
}
How do I call the information I need out of the array?