C - Write program to convert from radians to degrees

Requirements

Write a program that converts from radians to degrees.

Hint

One radian equals 57.2957795 degrees, and one degree equals 0.01745329 radians.

Demo

#include <stdio.h>

int main()/*w  w  w  .  ja va  2  s  .  c o m*/
{
    float degrees,radians;

    printf("Enter an angle in radians: ");
    scanf("%f",&radians);
    degrees = 57.2957795*radians;
    printf("%.2f radians is %.2f degrees.\n",radians,degrees);
    return(0);
}

Result

Related Exercise