Newton Backward Interpolation Interpolation
Aim: To implement Newton backward interpolation.
Algorithm Step 1: Start the program program Step 2: Declare x[20], [20], !, ", d, h, p a" !loat data tpe and i, #, k, n a" integer data tpe Step $: %ead the record n and read the element" o! x & '"ing !or loop Step (: )alc'late h * x[2] + x[1] Step : %ead the point which i" going to be "earched Step -: )alc'late: " * ! +x[n]/h, d * [n], p * 1 Step : "ing !or loop calc'late ! and d a [#] [#] * [#] [#] + [#3 [#31] 1] b p * p 4 "4 "4 k 31/ 31/k k c d * d 5 p 4 [n] [n] Step 6: print ! and d Step 7: Stop the program
Flowchart Start
!loat x[20], [20], !, ", d, h, p int i, # ,k, n read n e " l a 8
!ori * 19 i * n9 i55 read x[i]
e " l a 8
!ori * 19 i * n9 i55 read [i]
h * x[2] + x[1]
read !
" * !x[n]/h d * [n] p*1 e " l a 8
!ori * n, k * 19i ;* 1, k n, i33, k55
e " l a 8
!or# * n9 # ;* 19 #55 [#] *[#] +[#31] p * p 4 " 5 k + 1/k d * d 5 p 4 [n]
print !, d
Stop
Program 4?n>9 // 4@" print! >4?t?tAackward Bnterpoaltion?t?t?t4?n>9 print! >4?n?n>9 // 4@" print!>Cow man record o' will be enter:>9 "can!>d>,&n9 print!>enter the Eal'e o! x: ?n?n>9 !ori*19i*n9i55 = "can!>!>,&x[i]9 F print!>enter the Eal'e o! : ?n?n>9 !ori*19i*n9i55 = "can!>!>,&[i]9 F h*x[2]3x[1]9 print!>enter the "earching point !:>9 "can!>!>,&!9 "*!3x[n]/h9 d*[n]9 p*19 !ori*n,k*19i;*1,kn9i33,k55 = !or#*n9#;*19#33 = [#]*[#]3[#31]9 F p*p4"5k31/k9 d*d5p4[n]9 F print!>?n4//2 4@"TCG %GSHT4//2( 4@"?n>9 print!>!or !*! ,an" i"*!>,!,d9 getch9 ret'rn 09 F
Output