/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. *******************************************************************************/ // Example program #include #include #include "stdio.h" #include "math.h" using namespace std; int main() { float valSin, valCos, valTan; int deg = 0; // tampilan awal table // cout tabnya lebih oke // cout << "deg\t\t" << "sin(x)\t\t" << "cos(x)\t\t" << "tan(x)\t\t" << "\n"; printf("deg sin(x) cos(x) tan(x)"); cout << "\n"; while (deg <= 360) { if (deg % 25 == 0 && deg > 0) { cin.get(); } // memasukkan nilai ke var valSin = ceil(sin(deg) * 100.0) / 100.0; valCos = ceil(cos(deg) * 100.0) / 100.0; valTan = ceil(tan(deg) * 100.0) / 100.0; // tampilan dinamis per row // cout << deg << "\t\t" << valSin << "\t\t" << valCos << "\t\t" << valTan << "\n"; printf("%i %.2f %.2f %.2f", deg, valSin, valCos, valTan); cout << "\n"; deg += 1; // biar deg nambah dan ga bootloop } }