Advertisement
jerimin

summation

Oct 15th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     //var
  7.     double num;
  8.     double sum = 0;
  9.     //code
  10.    
  11.     for(num = 0.01; num <= 1.0; num += 0.01)
  12.     {
  13.         sum += num;
  14.        
  15.     }
  16.     cout << "The sum is " << sum << endl;
  17.  
  18.    
  19.    
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement