See the Series and according to series try to implement your logic .I just want to say only one thing if you practice more and more so you can solve and understood easily ,don't depend to copy paste answer .
#include<iostream>
using namespace std;
int main()
{
int i,a=-1,b,n;
cout<<"Enter The Number of Terms\n";
cin>>n;
for(i=1;i<=n;i+=3)
{
a*=-1;
b=i;
b*=a;
cout<<b<<" ";
}
return 0;
}
Output:
Enter The Number of Terms
40
1 -4 7 -10 13 -16 19 -22 25 -28 31 -34 37 -40
need an explanation for this answer? contact us directly to get an explanation for this answer