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();
}
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();
}
0 comments:
Post a Comment