//Console Ansøgning om at skabe stjerne pyramide ved hjælp af C # kode
< p> //For værdi på 4
< p> //*
< p> //* *
< p> //* * *
< p> //* * * *
< p> using System ;
< p> namespace STAR
< p> {
< p> class Class1
< p> {
< p> static void Main ( )
< p> {
< p> Console.WriteLine ( " Indtast værdi" ) ;
< p> int k = int.Parse ( Console.ReadLine () ) ;
< p> int n = k- 1 ,
< p> int x = 2 * ( k -1) +1 ,
< p> for (int p = 0; p < p> {
< p> for (int j = k- 1 j > = 0; j-- )
< p> {
< p> Console.
Write ("") ;
< p > }
< p> for ( int i = 0; i
{
< p> hvis (i % 2 == 1 )
< p> {
< p> Console. Skriv ( "*" ),
< p> }
< p> andet
< p> {
< p> Console.Write ("") ;
< p> } < br >
}
< p> Console.WriteLine ();
< p> k-- ;
< p> }
< p> Console.
ReadLine ();
}
< p> }
< p> }