fork download
  1. //Pranav Manur CS1A Chapter 2 pg.83 #16
  2. /*******************************************************************************
  3.  * CREATION OF A DIAMOND SHAPE PATTERN
  4.  * -----------------------------------------------------------------------------
  5.  * This program creates a diamond shape out of any character in this case an *
  6.  * The final shape is : *
  7.  * ***
  8.  * *****
  9.  * *******
  10.  * *****
  11.  * ***
  12.  * *
  13.  *
  14.  *------------------------------------------------------------------------------
  15.  * INPUT
  16.  * Any singular character wanted to make the diamond
  17.  *
  18.  * OUTPUT
  19.  * The final diamond shape shown above
  20.  *
  21. *******************************************************************************/
  22.  
  23. #include <iostream>
  24. using namespace std;
  25.  
  26. int main() {
  27.  
  28. //Create and assign a character to the char data type
  29. char a;
  30. a = '*';
  31.  
  32. // Display the output of the diamond
  33. cout << " " << a << endl << " " << a << a << a << endl << " " << a << a
  34. << a << a << a << endl << " " << a << a << a << a << a << a << a << endl <<
  35. " " << a << a <<a << a << a << endl << " " << a << a <<a << endl << " "
  36. << a << endl;
  37.  
  38.  
  39. return 0;
  40. }
Success #stdin #stdout 0s 5376KB
stdin
Standard input is empty
stdout
     *
    ***
   *****
  *******
   *****
    ***
     *