A textbook of Computer Based Numerical and Statiscal Techniques part 60. 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. | 576 COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES 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 1 Step 20. y2 p p 1 diff i - 1 2 2 Step 21. y3 p p 1 p-1 diff i - 2 3 6 Step 22. y4 p p 1 p 2 p-1 diff i - 3 4 24 Step 23. Print the output x y Step 24. End of the program. PROGRAM FOR CONSTRUCTING DIFFERENCE TABLE program for newton forward difference table include include include int fact int a if a 0 return 1 else return a fact a-1 void main float x 60 y diff 5 5 fx 60 u h temp sum int n i 0 j 0 k 0 clrscr printf enter the no. of values scanf d n printf n n enter the values of x having constant difference between them n for i 0 i n i scanf f x i printf n enter the values of y f x n COMPUTER PROGRAMMING IN C LANGUAGE 577 for i 0 i n i scanf f fx i for i 0 i n-1 i diff 0 i fx i 1 -fx i for i 1 i n-1 i for j 0 j n-1 j diff i j diff i-1 j 1 -diff i-1 j printf n n t newton forward difference table is n printf nX Y -Y for k 2 k n k printf -AO odY k printf n for i 0 i n i printf n printf f f x i fx i for j 0 j n-1-i j printf f diff j i getch PROGRAMMING FOR NEWTON S FORWARD INTERPOLATION METHOD include include include include int fac int a if a 0 return 1 else return a fac a-1 void main int x 60 X float dif 5 5 fx 60 float u h sum temp 578 COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES nt n i 0 j k 0 clrscr print Enter the no. of values scanf d n printf Enter the values of x having constant diff b w them n for i 0 i n i scanf d x i printf Enter the values of Y f x n for i 0 i n i scanf f fx i for i 0 i n-1 i dif 0 i fx i 1 -fx i for i 1 i n-1 i for j 0 j n-1-i j dif i j dif i-1 j 1 -dif i-1 j printf n t The Newton Forward Difference Table is given by - n printf nX tY t t-Y for k 2 k n k .