Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # include <iostream>
- # include <fstream>
- # include <sstream>
- # include <string>
- # include <istream>
- # include <stdio.h>
- # include <math.h>
- # include <stdlib.h>
- using namespace std;
- float funzi (float x) {
- return (sin(x)+2);
- int main();
- {
- float x,xp;
- float fprec;
- fprec = 0.01;
- cout<<"inserisci il valore iniziale di x"<<endl;
- cin>>x;
- do {
- xp=x;
- x=funzi (xp);
- cout<<x<<endl;
- }
- while (fabs((x*xp)/xp)<fprec);
- cout<<x;
- cout<<"il valore di precisione รจ questo"<<endl;
- return (0);}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement