Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #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;
- }
Add Comment
Please, Sign In to add comment