commit d77d7c05df4a6f025b4eb0f44e8beaf104a9b3bd
parent 0bc4ba3b48ac4e4b8c804092b4f5d56025e95f58
Author: Amit Dutta <amitdutta4255@gmail.com>
Date: Mon, 6 Oct 2025 18:49:02 +0530
new luc026
Diffstat:
1 file changed, 26 insertions(+), 0 deletions(-)
diff --git a/letusc/luc026.c b/letusc/luc026.c
@@ -0,0 +1,25 @@
+/* Write a program to recieve value of an angle in degreesand check
+whether sum of squares of sine and cosine of this angle is equal to 1. */
+/* Author - Amit Dutta, Date - 6th OCT, 2025 */
+/* Let Us C, Chap- 4, Page - 73, Qn No.: E(d) */
+
+#include <stdio.h>
+#include <math.h>
+#define EPSILON 0.0000001
+
+int main()
+{
+ double angle, result;
+ printf("Enter the angle value in degree : ");
+ // checking is the input is other than number.
+ if(scanf("%lf", &angle) != 1) {
+ printf("\nPlease enter a number.");
+ return 1;
+ }
+ angle = angle * (M_PI / 180); // converting degree to radian
+ result = pow(sin(angle), 2) + pow(cos(angle), 2);
+ (fabs(result - 1.0) < EPSILON) ?
+ printf("\nsum of squares of sine and cosine of this angle is equal to 1.") :
+ printf("\nsum of squares of sine and cosine of this angle is NOT equal to 1.");
+ return 0;
+}+
\ No newline at end of file