Hello friends… In this tutorial we will make a simple program for radians to degrees calculator. It is not the full radians to degrees calculator. But here we will make a simple demo program for the calculator. In this post we will simultaneously converts radians to degree and degree to radians. The
program given below is containing both options for simple conversions.

Simple Program for radians to degrees and degrees to radians calculator using c language


 #define PI 3.14159265

float DegreesToRadians(float degrees);
float RadiansToDegrees(float radians);

int main(void)
    int exit = 0, option = 0;
    float degrees = 0, radians = 0, angle = 0;
    while (exit == 0)
        printf(“n Kindly select perticuler option: “
               “nt[1] go for degrees to radians”
               “nt[2] go for radians to degrees”
               “nt[0] Stop the programn”);
        switch (option)
        case 1:
            printf(“n Enter angle in degree: “);
            angle = DegreesToRadians(degrees);
            printf(” The desired angle in radians for given degree:
        case 2:
            printf(“n Enter angle in radions: “);
            angle = RadiansToDegrees(radians);
            printf(” The desired angle in degree for given radians:
        case 0:
            exit = 1;
            printf(“nNot found please check it.”);
    printf(“nnClick on any key to stop…”);
    return 0;

Output of radians to degrees and degrees to radians:

rradians to degrees calculator

In this program the user will be asked to give particular input. As per the input given by the user, the output will be generated by program. There are three options in the program. First one converts degrees to radians, second one converts radians to degree and with the help of last one you can simply exit from the program. So in this way you can make a simple calculator of radians to degree and the same degrees to radians easily. Stay connected for more programming stuff.

By jigar

Leave a Reply

Your email address will not be published. Required fields are marked *