bsc

Comprehensive codebase and cou...
Log | Files | Refs | README | LICENSE

commit d77d7c05df4a6f025b4eb0f44e8beaf104a9b3bd
parent 0bc4ba3b48ac4e4b8c804092b4f5d56025e95f58
Author: Amit Dutta <amitdutta4255@gmail.com>
Date:   Mon,  6 Oct 2025 18:49:02 +0530

new luc026

Diffstat:
Aletusc/luc026.c | 26++++++++++++++++++++++++++
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
© notamitgamer • Site Built: 2026-07-21 13:58:23 UTC • git-mirror commit: 1037f62 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror