SHARE
TWEET

summation

jerimin Oct 15th, 2019 84 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.     //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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top