Square Star Pattern in Javascript Demo | Stackblitz

CODE:


// Import stylesheets
let n = 5// row or column count
// defining an empty string
let string = "";

for(let i = 0i < ni++) { // external loop
  for(let j = 0j < nj++) { // internal loop
    string += "*";
  }
  // newline after each row
  string += "\n";
}
// printing the string
console.log(string);


DEMO


   


Square Star Pattern in Javascript  Demo




No comments:

Post a Comment

CPU vs GPU Architecture

  CPU vs GPU Architecture CPU (Central Processing Unit) and GPU (Graphics Processing Unit) have distinct architectural differences, optimize...

Best for you