This blog is under construction

Sunday, 7 July 2013

C program to convert radians to degree

Write a C program to convert radians to degree.

  #include <stdio.h>
  #define DEGREETORADIAN 57.2957795

  int main() {
        float degree, radian;

        /* input radian from the user */
        printf("Enter the input in radian:");
        scanf("%f", &radian);

        /* converting degree to radian */
        degree = radian * DEGREETORADIAN;

        /* printing the output */
        printf("%.2f radian = %.2f degree\n", radian, degree);
        return 0;

  jp@jp-VirtualBox:~/$ ./a.out
  Enter the input in radian:1
  1.00 radian = 57.30 degree

See Also:

No comments:

Post a Comment