Created
January 31, 2018 03:32
-
-
Save tayadehritik/052941fedcd29eb489873ba42adcc83b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| using namespace std; | |
| int main() | |
| { | |
| int x, n; | |
| cout<<"enter 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