Computer Science, asked by jobanuppal2067, 10 months ago

The following program is suppose to use the sin() function in the math library and write out an input's absolute value over an interval. So for example if sine(0.6) is 0.564 then its absolute value is the same (0.564). But if sine(2.4) is -0.675 then its absolute value is 0.675.

Answers

Answered by sanjeevsitapur2
9

Answer:

from math import sin

n = # Any no. Negative or positive..

sine=abs(sin(n))

print(sine)

______________________

HOPE YOU UNDERSTAND IT!

Answered by sujan3006sl
2

Answer:

#include <stdio.h>

#include <math.h>

int main(void) {

  double interval;

  int i;

  for(i = 0; i <30; i++) {

      interval = i/10.0;

      printf("sin( %.1lf ) = %.3lf \t", interval, abs(sin(interval)));

  }

  printf("\n+++++++\n");

  return 0;

}

Explanation:

  • The C source code includes a void main programme that prints the absolute value of the sine() function for integers ranging from 0.1 to 3.0.

The programme is a loop demonstration

  • Loops are used in programming to conduct repetitive and iterative tasks.
  • The following are the C programme statements that complete the programme:
  • i/10.0; interval = i/10.0; interval = i/10.0; interval =
  • printf("sin( percent.1lf) = percent.3lf t", interval, abs(sin(interval))); printf("sin( percent.1lf) = percent.3lf t", interval, abs(sin(interval))

The following is the flow of the preceding statements:

  • The interval is determined by the first line.
  • The needed output is printed on the second line.

#SPJ3

Similar questions