63 036
Assignments Done
99,1%
Successfully Done
In July 2018

Answer to Question #52789 in C for raghu

Question #52789
Write a program that converts a number in Cartesian coordinates to polar form. The user will enter two values (real and imaginary parts of the number). The program will display the values of and r and O.
Expert's answer
#include <stdio.h>
#include <math.h>
int main()
{
double x, y;
scanf("%lf%lf", &x, &y);
double r, O;
r = sqrt(x*x + y*y);
O = atan(y/x);
printf("r = %lf\nO = %lf", r, O);
return 0;
}


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions