Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <cmath>
- #include <fstream> //needed to read or write files on disk
- #include <cstdlib>
- using namespace std;
- int main ()
- {
- int j,k,i,newsum,sum;
- int num[20]={1,2,3};
- for (k=3;k<=19;k++)
- {
- sum=0;
- for(i=k-1;k>=0;i--)
- {
- newsum=sum+num[i];
- newsum=num[k];
- }
- }
- for(j=1;j<=20;j++)
- {
- cout<<"Array entry number "<<j<<" is "<<num[j-1]<<endl;
- }
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement