write a c program to compute the value of a sine


Write a C program to compute the value of a sine wave from 0 to 2P with an increment of 0.1 radians.
 
#include stdio.h
#include math.h
#define pi 3.1415927
void main()
{
  char prompt;
  float x,y;
  for (x=0;x<=2*pi;x+=0.1)
  {
    y = sin(x);
    printf("The sin of %4.2f is %5.4f\n\r",x,y);
  }   
  printf("Press any key to exit \n\r");
  scanf("\n%c",&prompt); 
}

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: write a c program to compute the value of a sine
Reference No:- TGS0265316

Expected delivery within 24 Hours