68 758
Assignments Done
100%
Successfully Done
In January 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.
#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!