Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int ile,suma,i,j;
- cout<<"\nPodaj ile poczatkowych liczb nieparzystych chcesz dodac\n";
- cin>>ile;
- suma=0;
- for (i=0, j=1; i<ile; i++,j+=2)
- {
- suma+=j;
- }
- cout<<"\n Taka suma wynosi = "<<suma<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement