Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. #include <iostream>  
  2. #include <iomanip>
  3. #include <cmath>  
  4. #include <fstream>          //needed to read or write files on disk
  5. #include <cstdlib>
  6.        
  7.  
  8. using namespace std;
  9.    
  10. int main ()        
  11. {
  12.     int j,k,i,newsum,sum;
  13.     int num[20]={1,2,3};
  14.         for (k=3;k<=19;k++)
  15.         {
  16.             sum=0;
  17.             for(i=k-1;k>=0;i--)
  18.             {
  19.             newsum=sum+num[i];
  20.             newsum=num[k];
  21.             }
  22.         }
  23.         for(j=1;j<=20;j++)
  24.         {
  25.         cout<<"Array entry number "<<j<<" is "<<num[j-1]<<endl;
  26.         }
  27.     system("pause");
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement