Skip to content
Snippets Groups Projects
Commit 2c940328 authored by dhana surya's avatar dhana surya
Browse files

mirrored half diamond star pattern

parent ab57dce0
No related branches found
No related tags found
No related merge requests found
/*
mirrored half diamond star pattern
*
**
***
****
*****
****
***
**
*
*/
#include<stdio.h>
int main(){
int num = 5 ;
int space = num ;
int columns = 1 ;
for (int i=1 ; i< num*2;i++){
for (int k =space ; k > 1; k--){
printf(" ");
}
for ( int j=1; j<=columns;j++ ){
printf("*");
}
if (i < num){
columns ++;
space--;
}else{
columns--;
space++;
}
printf("\n");
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment