Friday 24 June 2016

C++ Program - Diamond Pattern

#include
using namespace std;
int power(int, int);
int main() {
  int i,j,k,limit;
  cout<<"Enter Number :";
cin>>limit;
    for(int i=1; i<=limit; i++) {
    for(int k=0; k  cout<<" ";
  for(int j=0; j  cout<<"*"<<" ";
}
cout< }
for(int i=limit-1; i>0; i--) {
for(int k=i; k  cout<<" ";
  for(int j=0; j  cout<<"*"<<" ";
}
cout< }
  return 0;  
}

No comments:

Post a Comment

CakePHP Date Picker

Folder Structure: Controller:   File location - cakephp/src/controller/HomepageController.php namespace App\Controller; use...