TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Pyramid Program
Padmanaban Pugalenthi
Aug 16
2016
Code
812
0
2
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
Pyramid.zip
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
namespace
Pyramid
{
class
Program
{
public
static
void
print(
int
no)
{
for
(
int
i = 1; i <= no; i++)
{
for
(
int
j = i; j <= no; j++)
{
Console.Write(
" "
);
}
for
(
int
k = 1; k <= 2 * i - 1; k++)
{
Console.Write(
"*"
+
" "
);
}
Console.WriteLine();
}
Console.ReadLine();
}
static
void
Main(
string
[] args)
{
Console.WriteLine(
"Enter the number of rows for the output"
);
int
r = Convert.ToInt32(Console.ReadLine());
print(r);
}
}
}
Pyramid Program
C#