Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.  
  7. int ile,suma,i,j;
  8. cout<<"\nPodaj ile poczatkowych liczb nieparzystych chcesz dodac\n";
  9. cin>>ile;
  10. suma=0;
  11. for (i=0, j=1; i<ile; i++,j+=2)
  12. {
  13. suma+=j;
  14. }
  15. cout<<"\n Taka suma wynosi = "<<suma<<endl;
  16. return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement