Printing Numbered Square Pattern
In this program we’re going to code a Java Program for printing number square star pattern.
The logic of this problem is to take a row and column input from user and store in the variable names as row and col and then take a for loop start from int i=1 i<=row and then take inner for loop start from j=1 to j<= col and then print 1 and then change the line
//javascript
function pattern() {
let n = 4;
for (let i = 0; i < n; i++) {
let sum = " ";
for (let j = 0; j < n; j++) {
sum += 1;
}
console.log(sum);
sum = " ";
}
}
pattern();
//pattern
// 1111
// 1111
// 1111
// 1111
Thank you prepinsta for publishing my code…