source file name: arrfr.cpp
#include<iostream.h>
#include<conio.h>
void main()
{
int i;
int A[]={10,20,-30,40,-50,60};
clrscr();
cout<<" Forward direction Array elements\n";
for(i=0;i<6;i++)
cout<<A[i]<<" ";
cout<<"\n Reverse direction Array elements\n";
for(i=5;i>=0;i--)
cout<<A[i]<<" ";
getch();
}
output:
0 Comments
Post a Comment