C language diamond algorithm