Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Star pattern in c#
WhatsApp
Debendra Dash
9y
26.8
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();
}
}
}
Up Next
Triangle/Diamond Pattern Programming In C#
Ebook Download
View all
Regular Expressions (Regex) in C#
Read by 197 people
Download Now!
Learn
View all
Membership not found