Write a program to receive cartesian co-ordinates (x,y) of an point and convert them into polar co-ordinates (r,o) - Code With Friends

Breaking

Home Top Ad

Search Your Questions

Friday, February 22, 2019

Write a program to receive cartesian co-ordinates (x,y) of an point and convert them into polar co-ordinates (r,o)

#include<stdio.h>
#include<math.h>
int main()
{
int x,y;
float r,theta;

printf("enter the value of coordinate  ");
scanf("%d %d",&x,&y);

r=sqrt(x*x+y*y);
theta= atan(y/x);

printf("the value in polar coordinate is %f,%f",r,theta);

}



No comments:

Post a Comment