A textbook of Computer Based Numerical and Statiscal Techniques part 61. By joining statistical analysis with computer-based numerical methods, this book bridges the gap between theory and practice with software-based examples, flow charts, and applications. Designed for engineering students as well as practicing engineers and scientists, the book has numerous examples with in-text solutions. | 586 COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES for i 0 i n-j i diff i j diff i 1 j-1 -diff i j-1 i 0 do i while ax i x i- - p x-ax i h y1 p diff i-1 1 y 2 p p 1 diff i-1 2 2 y3 p 1 p p-1 diff i-2 3 6 y4 p 1 p p-1 p 2 diff i-3 4 24 y ay i y1 y2 y3 y4 printf when x y x y printf press enter to exit getch OUTPUT Enter the no. of term -7 Enter the value in form of x- Enter the value of x1 - Enter the value of x2 - Enter the value of x3 - Enter the value of x4 - Enter the value of x5 - Enter the value of x6 - Enter the value of x7 - Enter the value in the form of y- Enter the value of y1 - Enter the value of y2 - Enter the value of y3 - Enter the value of y4 - Enter the value of y5 - Enter the value of y6 - Enter the value of y 7 - COMPUTER PROGRAMMING IN C LANGUAGE 587 Enter the value of x for Which you want the value of y - When x y Press enter to exit ALGORITHM FOR STIRLING S METHOD Step 1. Start of the program to interpolate the given data Step 2. Input the value of n number of terms Step 3. Input the array ax for data of x Step 4. Input the array ay for data of y Step 5. Compute h ax 1 - ax 0 Step 6. For i 0 i n-1 i Step 7. diff i 1 ay i 1 -ay i Step 8. End of the loop i Step 9. for j 2 j 4 j Step 10. for i 0 i n-j i Step 11. diff i j diff i 1 j-1 - diff i j-1 Step 12. End of the loop i Step 13. End of the loop j Step 14. i 0 Step 15. Repeat step 16 until ax i x Step 16. i i 1 Step 17. i i-1 Step 18. p x - ax i h Step 19. y1 p diff i 1 diff i - 1 1 2 Step 20. y2 p p diff i - 2 2 2 Step 21. y3 p p p-1 diff i - 1 3 diff i-2 3 6 Step 22. y4 p p p p-1 diff i - 2 4 24 Step 23. y ay i y1 y2 y3 y4 Step 24. Print the output x y Step 25. End of the program. PROGRAMMING FOR STIRLING S METHOD include include include include include 588 COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES void main int n int