Computer Science, asked by sarkarankita20p1ty6w, 1 year ago

Can anyone please tell me the program of the following pattern
#@#@#
@#@#
#@#
@#
#

Answers

Answered by harmankaur04
1
in basic

cls
for I = 5 to 1 step -1
for J=i to 1 step -1
if J MOD 2 = 0 then print "@" else print "#"
next j
next i
end


in Java..
class Program
{
public static void main ()
{
for (int i=5;i>=1 ;i--)
{
for (int j= i; j>=1 ;j--)
{
if (j%2==0)
System. out. println("@");
else
System. out. println("#");
}
}
}
}
Similar questions