Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- double h(double a){return ( 1 + 2*sin(a/57.2957795) ) / 2;}
- int main(void)
- {
- double xsifir, epsilon, fark;
- printf( "X0 = " ); scanf( "%lf" , &xsifir );
- printf( "epsilon = " ); scanf( "%lf" , &epsilon );
- printf( abs( cos( xsifir/57.2957795 ) < 1) ? "\nYakinsaktir.\n\n" : "\nIraksaktir.\n\n");
- do{
- fark = xsifir-h(xsifir);
- printf("fark = %.20lf , kok = %.16lf\n", fark, h(xsifir));
- if( fark > epsilon ){ xsifir = h(xsifir); }
- } while ( fark > epsilon );
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement