#include <stdio.h>
#include <math.h>
int main(void)
{
double r,d,x,y,pi;
clrscr();
printf("Input the value of r and degree: ");
//scanf("%f",&r);
//scanf("%f",&d);
r = 12;
d = 195;
pi = 3.14;
x = r * cos(d * pi/180);
y = r * sin(d * pi/180);
printf("The polar form is: (%f,%f)", x, y);
getch();
}
In the 1st case with defined values of r and d the output comes correct but in 2nd case when I give the input the output doesn't match with the original answer. The code worked on codeblocks but isn't working on turbo c++.
what am I doing wrong in turbo c++?