Showing posts with label 2D Array of pointer. Show all posts
Showing posts with label 2D Array of pointer. Show all posts

Friday, 15 June 2012

Program To Print Pyramid


Program To Print Pyramid

#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
main()
{
clrscr();
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
}
cout<<"\n";
}
getch();
}

Thursday, 19 January 2012

Program Of 2D Array of Pointer In C++


#include<iostream.h>
#include<conio.h>
main()
{
clrscr();
int i,j,a[3][3],*ptr;
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
cout<<"Enter NUmber=";
cin>>a[i][j];
}
}

for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
ptr = &a[i][j];
cout<<"\n Value of a["<<i<<"]["<<j<<"]==>"<<a[i][j]<<" And Address of a["<<i<<"]["<<j<<"]==>"<<ptr;
}
cout<<"\n";

}
getch();
}