while(x <= coba){
if (x% 2 == 1){
Cek++;
}
else{
Cek+=2;
}
cout<< cek << endl;
x++;
}
return 0;
}
if cek =5
i need 1,2,4,7,8
but my code still 2,4,5,7,8
Please can anyone solve the following two questions for me its really very difficult same as given questions through c++ …
Sum=1-1/1!+2/2!-3/3!…..n/n!
Sum=x-x^3/3!+x^5/5!-x^7/7!+….x^n/n!
7. //Computes for the Summation of the series 1^1 + 2^2 + 3^3 + … + n^n…
#include
#include
using namespace std;
long long series (int n);
int main()
{
int _____;
cout <> n;
for (int i = __1__; i<=n; i++)
if (i<_____)
cout << i << “^” << “+”;
else
cout << i << “^” << “–”;
cout << _____ (n) << endl;
system(“pause”);
}
_long_ series int(_____)
{
If (n==0)
return(_____);
else
return pow(n,n) + series(_____);
}
1/x+2/x×x+……….n/x×n
Answer of the coading
program in c++ to find sum of series sum=1+(1+2)+(1+2+3)+……………..n
#include
#include
void main()
{
int i,j,n,sum=0;
clrscr();
n=10;
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
sum+=j;
}
}
cout<<"Sum: "<<sum;
getch();
}
bhai may nay ek program solve karna hy jis may hum nay ye series banana 1+1/4+1/8+1/12+…1/100
kay ap bata saktay ho kaisay maloom karni hy c++ may
#include
using namespace std;
void main()
{
float num=0;
for (float i=4; i<=100; i=i+4)
{
num=num+(1/i);
}
num=num+1;
cout << num;
system("pause");
}
Num should start from 1.
leave first term take 1/4 common and then execute the for loop
bro what is the program for this series
1+1+2+1+2+3+1+2+3+4+…………..1+2+3+………+n
#include
#include
void main()
{
int i,j,n,sum=0;
clrscr();
cout<>n;
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
sum+=j;
if(j==n)
{
cout<<j;
}
else
{
cout<<j<<"+";
}
}
}
cout<<"\nTotal Sum="<<sum;
getch();
}
can you help me with
#include
#include
using namespace std;
int main(){
int cek=1, x=1, coba;
cin >> coba;
while(x <= coba){
if (x% 2 == 1){
Cek++;
}
else{
Cek+=2;
}
cout<< cek << endl;
x++;
}
return 0;
}
if cek =5
i need 1,2,4,7,8
but my code still 2,4,5,7,8
Please can anyone solve the following two questions for me its really very difficult same as given questions through c++ …
Sum=1-1/1!+2/2!-3/3!…..n/n!
Sum=x-x^3/3!+x^5/5!-x^7/7!+….x^n/n!
Sum of the Series 1 – 1/1! – 2/2! + 3/3! – 4/4! + ……1/N!
/* Program */
#include
using namespace std;
double sumseries(double);
main()
{
double number,sum;
cout<>number;
sum = sumseries(number);
cout<<"\n Sum of the above series = "<<sum;
}
double sumseries(double m)
{
double sum2 = 0, f = 1, i;
int count = 0;
for (i = 1; i <= m; i++)
{
f = f * i;
if(count%2!=0)
sum2 = sum2 +(i / f);
else
sum2 = sum2 – (i/f);
count++;
}
return(1-sum2);
}
Sum of the Series 1 – 1/1! + 2/2! – 3/3! + 4/4! – ……1/N!
/*
* C++ Program
*/
#include
using namespace std;
double sumseries(double);
main()
{
double number,sum;
cout<>number;
sum = sumseries(number);
cout<<"\n Sum of the above series = "<<sum;
}
double sumseries(double m)
{
double sum2 = 0, f = 1, i;
int count = 0;
for (i = 1; i <= m; i++)
{
f = f * i;
if(count%2!=0)
sum2 = sum2 +(i / f);
else
sum2 = sum2 – (i/f);
count++;
}
return(1-sum2);
}
well
1+3+5+7-6+8+10+12-11+13+15+17-16+18+20+22………..n
sum of series
anybody can solve this
3×(5+18/2) I want a program in c++
2/1*2/3*4/3*4/5…..2n/2n-1
some one to help me on this question using c++
Sum of series of
1-1/2+1/3+1/4+….1/100
how to do this
1+3+5+….+19=?
I don’t know how to do this?
If you can please help me
Output of this program?
calculate the sum of following series
1/2+2/3+3/4+……+n/(n+1)
a. Calculate the summation of the series: 1+2+3+4+… … … +20 (using loop)
b. Calculate the area of the triangle. [Hints: area of triangle = 0.5 x base x height]
7. //Computes for the Summation of the series 1^1 + 2^2 + 3^3 + … + n^n…
#include
#include
using namespace std;
long long series (int n);
int main()
{
int _____;
cout <> n;
for (int i = __1__; i<=n; i++)
if (i<_____)
cout << i << “^” << “+”;
else
cout << i << “^” << “–”;
cout << _____ (n) << endl;
system(“pause”);
}
_long_ series int(_____)
{
If (n==0)
return(_____);
else
return pow(n,n) + series(_____);
}
Write a program to compute sum up to the n terms following series
S=1-2+3-4+5-6+7-8+9-…..….n