I have a part of code that cannot show the result as shown below:
patter#1
*****
****
***
**
*
pattern2
*
**
***
****
*****
pattern3
*****
****
***
**
*
Any idea to solve the incorrect code below:
#include <iostream.h>
using namespace std;
int main(){
int i=0 ;
int j=0 ;
for(i=0;i<5;i++){
for(j=0;j<1;j++){
cout<<" ";
}
for(j=0;j<5;j++){
cout<<"*";
cout<<endl;
}
}
i=0;
j=0;
for(i=0;i<5;i++){
for(j=i;j<4;j++){
cout<<" ";
}
for(j=0;j<1;j++){
cout<<"*";
}
cout<<endl;
}
i=0;
j=0;
for(j=0;j<5;j++)
for(i=0;i<4;i++){
cout<<" ";
}
for(i=0;i<1;i++){
cout<<"*";
}
cout<<endl;
system("pause");
}