daily pastebin goal
20%
SHARE
TWEET

Untitled

a guest Oct 16th, 2018 61 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  1. #include <iostream>
  2. #include <math.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.   int x;
  9.   int i = 1;
  10.   int result;
  11.   cout <<" Enter the value for n" << endl;
  12.   cin >> x;
  13.  
  14.   while (i >x)
  15.   if (i%2 == 0) {}
  16.  
  17.   else {
  18.  
  19.     result += pow(i,3);
  20.     i++;
  21.   }
  22.  
  23.   cout << "The sum of odd integers cubes from " << i << " to " << x << "= " << result << endl;
  24.  
  25.  
  26.  
  27.   return 0;
  28.  
  29. }
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