Skip to content

Instantly share code, notes, and snippets.

@tayadehritik
Created January 31, 2018 03:29
Show Gist options
  • Select an option

  • Save tayadehritik/6380da36bd23bf71174491587b5f8424 to your computer and use it in GitHub Desktop.

Select an option

Save tayadehritik/6380da36bd23bf71174491587b5f8424 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main()
{
int x, n;
cin>>n;
int be =2;
int s=0;
int power = 2;
for(int i=0;i<n;i++){
if(i%2==0){
if(i==0){
cout<<"1";
}
else{
cout<<"-X^"<<power<<"/"<<be;
power++;
be = be +2;
}
}
else{
cout<<"+X^"<<power<<"/"<<be;
power++;
be = be+2;
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment