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
how we write decision tables, flowcharts,pseudocode,and algorithm in result management system

The break statement The break statement, which was already covered in the switch.. case, can also be used in the loops. When a loop statement is encountered in the loops the co

Intelligent homes are becoming increasingly popular as the cost/performance ratio of microcontrollers is continuously dropping.  These systems incorporate various transducers to de

Question 1 Write a program in ‘C' to check whether a given number is even or odd Question 2 Explain while and do... while loop with an example Question 3 Write a program

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Virtual Base Classes This ambiguity can be resolved if the class derived have only one copy of the class base. This can be done by making the base class a virtual class. This k

Question 1 What are the different steps in executing a C program? Explain Question 2 What are the commonly used input/output functions in C? How are they accessed?

one of the applications of computers in numerical analysis is computing the area under a curve. one method of calculating the area under acurve is to divide the area int a number o

Virtual Functions The keyword virtual was previously used to resolve ambiguity for a class derived from two classes, both having a common ancestor. These classes are known as v

Write the statements which are used to connect PHP with MySQL? Statements which can be used to connect PHP with MySQL is: $conn = mysql_connect('localhost'); echo $co