good afternoon
i have a task of printing the numbers in two different forms.
First, if i give a value of 5 the result should be
******** 1
******* 2 3
****** 4 5 6
***** 7 8 9 10
*** 11 12 13 14 15
second, if i give a value of 5 the result should be
1
2 3
4 5 6
7 8 9 10
i am writing the code for first one as
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Pyramid : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnsubmit_Click(object sender, EventArgs e)
{
int n = int.Parse(txtenternoofrows.Text);
int i, j, k = 1;
for (i = 1; i < n; i++)
{
for(j=1; j<i+1; j++)
{
Response.Write("k++");
}
Response.Write("\n");
}
}
}
please help me