Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #include<cstdlib>
  2. #include<iostream>
  3. #include<cmath>
  4. #include<iomanip>
  5. using namespace std;
  6. int main()
  7. {
  8. int i;
  9. i=0;
  10. float n,a=0;
  11. cout<<"Podaj liczbe iteracji n"<<endl;
  12. cin>>n;
  13. while (i<=n)
  14. {
  15.  
  16. a=a+pow(2,i);
  17. i++;
  18. cout<<"pokaz"<<a<<endl;
  19. }
  20. cout<<"KONIEC"<<endl;
  21. system("pause");
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement