Pages

Showing posts with label SERIES. Show all posts
Showing posts with label SERIES. Show all posts

Tuesday, 22 March 2011

PROGRAM TO PRINT SERIES

DESCRIPTION-:THIS PROGRAM PRINTS THE SERIES LIKE
N .......5 4 3 2 1 0 1 2 3 4 5........N.
PROGRAM-:   
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i,n;
cout<<"enter the value of n";
cin>>n;
for(i=n;i>=0;i--)
{
cout<<i;
}
for(i=1;i<=n;i++)
{
cout<<i;
}
getch();
}

Friday, 18 March 2011

PROGRAM TO PRINT SERIES

DESCRIPTION-:THIS PROGRAM PRINT SERIES AS
1+X^2+X^4+X^6...............


PROGRAM-:
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
int n,x,i,sum=1,k;
cout<<"enter no of elements";
cin>>n;
cout<<"enter value of x";
cin>>x;
k=2*n-1;
for(i=2;i<=k;i=i+2)
{
sum=sum+pow(x,i);
}
cout<<"sum is"<<sum;
getch();
}

PROGRAM TO PRINT SERIES

DESCRIPTION-:THIS PROGRAM PRINT SERIES AS
1 2 3 4
1 2 3
1 2
1

PROGRAM-:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i,j,n;
cout<<"enter the value of n";
cin>>n;
for(i=n;i>0;i--)
{
cout<<"\n";
for(j=1;j<=i;j++)
{
cout<<j;
}
}
getch();
}

PROGRAM TO PRINT SERIES

DESCRIPTION-:THIS PROGRAM PRINT THE SERIES AS
4 3 2 1
3 2 1
2 1
1

PROGRAM-:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i,j,n;
cout<<"enter the value of n";
cin>>n;
for(i=n;i>0;i--)
{
cout<<"\n";
for(j=i;j>0;j--)
{
cout<<j;
}
}
getch();
}

PROGRAM TO PRINT SERIES

COMMENTS-:THIS PROGRAM PRINT SERIES AS
1
1 2
1 2 3
1 2 3 4


PROGRAM-:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i,j,n;
cout<<"enterthe value of n";
cin>>n;
for(i=1;i<=n;i++)
{
cout<<"\n";
for(j=1;j<=i;j++)
{
cout<<j;
}
}
getch();
}

PROGRAM TO PRINT SERIES

DESCRIPTION-:THIS PROGRAM PRINT THE SERIES AS
1
2 1
3 2 1
4 3 2 1 


PROGRAM-: 
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i,j,n;
cout<<"enterthe value of n";
cin>>n;
for(i=1;i<=n;i++)
{
cout<<"\n";
for(j=i;j>=0;j--)
{
cout<<j;
}
}
getch();
}
 
Copyright (c) 2010 Concepts Of C++. Design by WPThemes Expert

Blogger Templates and RegistryBooster.