Skip to content

Commit

Permalink
code to print rhombus
Browse files Browse the repository at this point in the history
  • Loading branch information
Arunkumar1712 authored Jan 8, 2024
1 parent 4744b39 commit 11c926d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions rhombus.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
var n=5;
var str="";
for(var i=0;i<n;i++){
for(var j=n-i;j>=1;j--){
str+=" ";
}
for(var k=0;k<2*i-1;k++){
str+="*";
}
str+="\n";

}

console.log(str);

0 comments on commit 11c926d

Please sign in to comment.