I am a beginner at using C++ so I was wondering if someone would be able to help me out as I'm currently trying to print a 'for' loop. The 'alfa' loop is printing correctly but when that information is called upon by the 'sina' loop, only zeros are being printed in the console.
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cmath>
#include <new>
#include <ctime>
#include <string>
#include <sstream>
#include <vector>
const double convToRad = pi/180.0;
int main(){
int INDEX = 91;
double alfa[INDEX] {0};
double sina[INDEX] {0};
for (int p = 90; p >= 0; p--){
alfa[INDEX] = p*convToRad;
//std::cout << alfa[INDEX] << std::endl;
}
for (int e = 0; e <= 90; e++){
sina[INDEX] = sin(alfa[INDEX]);
std::cout << sina[INDEX] << std::endl; //only prints 0's
}
return 0;
}