{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lee_assig13a

# Lee_assig13a - cout&amp;lt&amp;lt&amp;quot;The...

This preview shows page 1. Sign up to view the full content.

Sheet1 Page 1 //Cheu Lee Assig13 #include<iostream> #include<cmath> using namespace std int main() { int n, sum=0 i cout<<"Please enter the value of n: " cin>>n for(int k=1 k<=n k++) sum+=k*k cout<<"The summation is: "<<sum/pow(n,3)<<endl //Summation of n=48 is 0.343822 double c, result=0 { cout<<"Please enter a positive integer: "<<endl cin>>c for (int v=1 v<=c v++) result+=(((v*8)/c)*((v*8)/c)+1)
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cout&amp;lt;&amp;lt;&amp;quot;The summation is: &amp;quot;&amp;lt;&amp;lt;result*(8/c)&amp;lt;&amp;lt;endl //Summation of v=96 is 181.343 double a, q=0 cout&amp;lt;&amp;lt;&amp;quot;Please enter a positive interger: &amp;quot;&amp;lt;&amp;lt;endl cin&amp;gt;&amp;gt;a for(int i=1 i&amp;lt;=a i++){ q=pow(1+(1/a),a) } cout&amp;lt;&amp;lt;&amp;quot;The first 'a' value is: &amp;quot;&amp;lt;&amp;lt;q&amp;lt;&amp;lt;endl c //The value of 'a'= 3 then 1st'a'=2, 2nd'a'=2.5, 3rd'a'=2.3037 return 0 } }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online