#include #include void main() { clrscr(); //clears the previous screen //Printing pattern int i,space,rows,k=0,count=0,count1=0; cout<<"Enter the number of rows: "; cin>>rows; for(i=1; i<=rows; ++i) { for(space=1; space<=rows-i; ++space) { cout<<" "; ++count; } while(k!=2*i-1) { if (count<=rows-1) { cout<