Answer to Question #27866 in C++ for anahid

Question #27866
Write a c++ program for the sequence, ∑_(i=1)^n=2^(3^i )/i=2^(3^1 )/1+2^(3^2 )/2+2^(3^3 )/3+⋯+2^(3^n )/n if the manual input is n.
1
Expert's answer
2013-04-09T10:26:33-0400
#include <iostream>

using namespace std;

//main function
int main()
{
int n=0;
cout<<"Enter n: ";
cin>>n;//enter n
int sum=0;
for(int i=1;i<n;i++){
sum+=pow(2,(pow(3.0,i)/i));
}
//show result
cout<<"Sum = "<<sum;
cin>>n;//delay
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS