0
Write code to Print below simple design.
* * * * * * * * *
2 Respuestas
+ 3
Could you link your trial code here?
Also, you could look up this page:
" Program to print the diamond shape"
https://www.google.co.in/amp/s/www.geeksforgeeks.org/c-program-print-diamond-shape/amp/
+ 1
var a = 5; //number of lines to print
var b;
var s=(a/2)+1;
for(b=1;b<=(a/2)+1;b++)
{
for(c=1;c<=s;c++){
document .write (" ");
}
s--;
for(d=1;d<=b;d++){
document .write(" *");
}
document .write ("<br />");
}
//after half
s=(a/2);
for(b=(a/2);b>1;b--){
for(c=1;c<s;c++){
document .write (" ");
}
s++;
for(d=1;d<b;d++){
document .write (" *");
}
document .write ("<br />");
}