Advertisement
ksszztof

kod petla for

Aug 29th, 2015
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3. #include <cmath>
  4.  
  5. using namespace std ;
  6. int main ()
  7. {
  8.  
  9. cout << "Podaj liczbe ktora chcesz pierwiastkowac:" <<endl;
  10. float root ;
  11. cin >> root ;
  12. cout << "Podaj liczbe iteracji:" <<endl;
  13. int liczba_iteracji ;
  14. cin>> liczba_iteracji ;
  15. cout << "Podaj liczbe poczatkowa:" <<endl;
  16. float *x0 ;
  17. cin>> *x0 ;
  18. float x1;
  19. for(int i=0;i<=liczba_iteracji;i++) ;
  20.  
  21. {
  22.  
  23. x1=0,5*((*x0)+(root/(*x0)) ;
  24. x1=x0 ;
  25. cout << x1 ;
  26. }
  27. system ("pause");
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement