76 812
Assignments Done
Successfully Done
In June 2019

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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions