pattern print-1
Que- print the following pattern
1
21
321
4321
54321
code in javaScript
let n=5;
let row=1;
while(row<=n)
{
let col=1;
let line='';
while(col<=row){
line += (row-col+1);
col=col+1;
}
console.log(line);
row=row+1;
}
Que- print the following pattern
1
21
321
4321
54321
code in javaScript
let n=5;
let row=1;
while(row<=n)
{
let col=1;
let line='';
while(col<=row){
line += (row-col+1);
col=col+1;
}
console.log(line);
row=row+1;
}