Q8 Write a program to receive value of an angle in degrees and check whether sum of squares of sine and cosine of this angle is equal to 1.

Write a program to receive value of an angle in degrees and check whether sum of squares of sine and cosine of this angle is equal to 1.

Program: 66

Write a program to receive value of an angle in degrees and check whether sum of squares of sine and cosine of this angle is equal to 1.

#include<stdio.h>
#include<conio.h>
#include<math.h>
int main()
{
    int degree, result;

    printf("Enter the degree of angle: ");
    scanf("%d", &degree);

    result = (sin(degree)*sin(degree) + cos(degree)*cos(degree));

    printf("Result is: %d", result);
    return 0;
}

Output:

 Enter the degree of angle: 45
Result is: 1

Β 

Lokesh Kumar: Being EASTER SCIENCE's founder, Lokesh Kumar wants to share his knowledge and ideas. His motive is "We assist you to choose the best", He believes in different thinking.

View Comments (1)

  • Trigonometric functions are functions of an angle which are used to relate the angles of a triangle to the lengths of the sides of a triangle. For example, as depicted below, if we have a right triangle with one angle ΞΈ, having a as the opposite, b as the adjacent and c as the hypotenuse, then the following hold true.
    sinπœƒ=π‘Žπ‘ , cosπœƒ=𝑏𝑐 and tanπœƒ=π‘Žπ‘
    Write a program that takes the values of the lengths of the hypotenuse (c) and the adjacent (b) from a user and finds angle 𝜽 by passing these lengths to the function findAngle. After finding and returning the angle 𝜽, your program should covert the angle 𝜽 from degrees into radians using the formula shown below: π‘Ÿπ‘Žπ‘‘π‘–π‘Žπ‘›π‘ = πœ‹180Β°Γ—π‘‘π‘’π‘”π‘Ÿπ‘’π‘’π‘ 
    The calculated angle 𝜽 should then be displayed both in degrees and radians on the screen.

Related Post
Leave a Comment

This website uses cookies.