Write a c program to compute the value of a sine wave, C/C++ Programming

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); 
}

Posted Date: 4/16/2013 1:41:50 AM | Location : United States







Related Discussions:- Write a c program to compute the value of a sine wave, Assignment Help, Ask Question on Write a c program to compute the value of a sine wave, Get Answer, Expert's Help, Write a c program to compute the value of a sine wave Discussions

Write discussion on Write a c program to compute the value of a sine wave
Your posts are moderated
Related Questions
Program to show the ascii value of characters: int main() {                 int one_char;                 cout                 one_char = getch();

Ask question #write statement that assign random integer to the varaible n in the (100

A: In C++ the access privileges are public, private and protected. The default access level assigned to members of a class is private. Private members of any class are accessible o

Why are all header files not declared in every C program? - Declaring all header files in each program would result in increase in overall file size and load of the program. It


create a shopping cart in c++

Define Advantages of Multi File Program? The main merits of spreading a program across several files are: • Teams of programmers able to work on programs. Every programmer w

find the greater of the two variables, without using conditional loops or ternary operators?

Give practice in writing program''s..

Define some Important Point for bit fields with structures? Only n lower bits will be assigned to an n bit number thus type cannot take values larger than 15 (4 bits long)