C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Star pattern in c#
WhatsApp
Debendra Dash
10y
27.2
k
0
2
25
Blog
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
namespace
variables
{
class
demo
{
static
void
Main(
string
[] args)
{
Console.WriteLine(
"enter value of n"
);
int
n = Convert.ToInt32(Console.ReadLine());
for
(
int
i = n; i >= 1; i--)
for
(
int
j = 1; j <= i; j++)
{
Console.Write(j);
}
}
Console.ReadLine();
}
}
}
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
namespace
variables
{
class
demo
{
static
void
Main(
string
[] args)
{
Console.WriteLine(
"enter value of n"
);
int
n = Convert.ToInt32(Console.ReadLine());
for
(
int
i = n; i >= 1; i--)
{
Console.WriteLine(
" "
);
for
(
int
j = 1; j <= i; j++)
{
Console.Write(
" "
);
}
for
(
int
q = i; q <= n; q++)
{
Console.Write(
" * "
);
}
}
Console.ReadLine();
}
}
}
People also reading
Membership not found