Question: Write a program that calculates the sinc function and stores the results in an array with 1000 values. Your program should contain two arrays: Stores

Write a program that calculates the sinc function and stores the results in an array with 1000 values. Your program should contain two arrays:

  1. Stores x values between -2pi and 2pi with increments of 4*pi/SIZE
  2. Stores y = sin( x * pi ) / (x * pi)
  3. #include #include

    int main( void ) { // declare array with 1000 values const int SIZE = ; const double pi = 3.14159265359; // x array starts at -2*pi and increments at 4*pi/SIZE // calculate sinc function = sin(pi*x)/pi*x at every x value

    // print out every 50 values printf(" X\tSINC(X) "); for( int i = 0; i < SIZE; i = i + 50) { printf("%6.2lf\t%6.2lf ", x[i], sinc[i]); }

    return 0; }

C program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!