Tafsiran geometri untuk metode selisih mundur :
Contoh kode program C++ penyelesaian metode selisih mundur untuk persamaan f = x^x^x.
#include <iostream> #include <math.h> #include <stdio.h> using namespace std; float selisihMundur(float x, float h); int main(){ float x1,h1; cout << "masukan nilai h :"; cin >> h1; cout << "masukan nilai x :"; cin >> x1; cout << "selisih mundur fungsi x^x^x :"; cout << selisihMundur(x1,h1); return 0; } float selisihMundur(float x, float h){ float f,f2,f3,f4; f = x-h; f2 =pow(f,f); f3 =pow(f,f2); f4 = (x-f3)/h; return f4; } |
keluaran program
0 komentar:
Posting Komentar