Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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:
- Stores x values between -2pi and 2pi with increments of 4*pi/SIZE
- Stores y = sin( x * pi ) / (x * pi)
-
#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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started