package programs;
import java.util.Scanner;
public class Pattern6
{
public static void main(String[] args)
{
int i ,j;
int n = 6;
for(i = n; i>0 ; i-- )
{
for(j = 0; j<i ; j++)
{
System.out.print("*");
}
System.out.println("");
}
}
}
Python
for i in range(1,6):
for j in range(1, 6-i+1):
print("*"+" "),
print("");
C program
#include <stdio.h>
int main()
{
int i ,j;
for(i = 5; i>0 ; i-- )
{
for(j = 0; j<i ; j++)
{
printf("*");
}
printf("\n");
}
return 0;
}
C# program
using System;
public class Program
{
public static void Main(string[] args)
{
for (int row = 5; row >= 1; --row)
{
for (int col = 1; col <= row; ++col)
{
Console.Write("*");
}
Console.WriteLine();
}
}
}
JAVA
Python
C program
C# program
PHP program
need an explanation for this answer? contact us directly to get an explanation for this answer