pattern


#include
#include

void display(int);
void main()
{
int n;
clrscr();
cout<<"Enter The No:"; cin>>n;
display(n);
getch();
}
void display(int n)
{
for(int i=1;i<=n;i++) { for(int j=n;j>=i;j--){
cout<<" ";
}
for(int k=1;k<=i;k++){
cout<<"*";
}
cout<<"\n";
}
}

2 comments:

hemant said...

how do i start programing in java?

hemant said...
This comment has been removed by the author.

Post a Comment