Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 19th, 2012  |  syntax: None  |  size: 0.21 KB  |  views: 24  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. void drawDiamond(){
  2. int i=0, j=0, NUM=4;
  3.          
  4. for(i=-NUM; i<=NUM; i++) {
  5.          
  6. for(j=-NUM; j<=NUM; j++){
  7.                  
  8.         if( abs(i)+abs(j)<=NUM)
  9.                  
  10.          { cout<<"*"; }
  11.          
  12.         else { cout<<" ";}
  13.          
  14.         }
  15.          cout<<endl;
  16.                 }
  17.         }