last * pattern in C++
Print Star Triangle
#include<iostream.h> #include<conio.h> using namespace std; main() { int i, j, k; for(i=5;i>=1;i--) { for(j=5;j>i;j--) { cout<<" "; } for(k=1;k<=i;k++) { cout<<"*"; } cout<<"\n"; } getch(); }
Output
* * * * * * * * * * * * * * *
0 on: " last * pattern in C++"