hi guys i need help with this program.
i need to produce a table chart of sin cos and tan from angle 1-20 using do-while loop.
currently, i have this code but there's something wrong with the output. pls i need help thanks!
#include<iostream.h>
#include<conio.h>
#include<math.h>
int main()
{
clrscr();
int z=0;
double w,x,y;
w=sin(z);
x=cos(z);
y=tan(z);
cout<<"Angle"<<"\t"<<"Sin"<<"\t"<<"Cos"<<"\t"<<"Tan"<<endl;
do
{
cout<<z<<"\t"<<w<<"\t"<<x<<"\t"<<y<<"\t"<<endl;
z++;
}
while(z<=20);
getch();
return 0;
}
the output must be
Angle Sin Cos Tan
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
and then the corresponding value in sin cos tan of the angles
otherwise you'll divide by an int (180) and get an int result again.
Output your calculated angle in radians (next to where you output degrees) as well to check.