Solution for Exercise 11-14
ex1114
#include <stdio.h> int main() { 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); }
Notes
* This solution involves swapping the degrees
and radians
variables throughout the code, but also specifying the number of degrees in a radian for the calculation in Line 9.
* Here is a sample run:
Copyright © 1997-2024 by QPBC.
All rights reserved