Assignment
Assignment
Assignment
UI Code
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="txtOne" runat="server"></asp:TextBox><br />
<asp:TextBox ID="txtTwo" runat="server"></asp:TextBox><br />
<asp:Button ID="btnAdd" runat="server" Text="Add" OnClick="btnAdd_Click"
/><br />
<asp:Label ID="lblResult" runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
</html>
Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Assignment
{
public partial class AddTwoNumbers : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
2. Write a program using ASP.net to input a number and find the factorial.
UI Code
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="txtNumber" runat="server"></asp:TextBox><br />
<asp:Button ID="btnAdd" runat="server" Text="Factorial"
OnClick="btnAdd_Click" /><br />
<asp:Label ID="lblResult" runat="server" Text="Factorial"></asp:Label>
</div>
</form>
</body>
</html>
Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Assignment
{
public partial class Factorial : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
3. Write a program using ASP.net to input a number and check Number is Prime or Not.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="txtNumber" runat="server"></asp:TextBox><br />
<asp:Button ID="btnPrime" runat="server" Text="Prime Number"
OnClick="btnPrime_Click" /><br />
<asp:Label ID="lblResult" runat="server" Text="Not Prime"></asp:Label>
</div>
</form>
</body>
</html>
Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Assignment
{
public partial class PrimeNumber : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
}
4. Write a program using ASP.net to display prime numbers between two numbers.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="txtNumberStart" runat="server"></asp:TextBox><br />
<asp:TextBox ID="txtNumberEnd" runat="server"></asp:TextBox><br />
<asp:Button ID="btnPrime" runat="server" Text="Prime Number"
OnClick="btnPrime_Click" /><br />
<asp:ListBox ID="ListBox1" runat="server" Width="360px"></asp:ListBox>
</div>
</form>
</body>
</html>
Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Assignment
{
public partial class PrimeBetweenTwoNumbers : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="txtNumber" runat="server"></asp:TextBox><br />
<asp:Button ID="btnReverse" runat="server" Text="Reverse Number"
OnClick="btnReverse_Click" /><br />
<asp:Label ID="lblResult" runat="server" Text="0"></asp:Label>
</div>
</form>
</body>
</html>
Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Assignment
{
public partial class ReverseNumber : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="txtNumberStart" runat="server"></asp:TextBox><br />
<asp:TextBox ID="txtNumberEnd" runat="server"></asp:TextBox><br />
<asp:Button ID="btnReverse" runat="server" Text="Reverse Number"
OnClick="btnReverse_Click" /><br />
<asp:ListBox ID="ListBox1" runat="server" Width="360px"></asp:ListBox>
</div>
</form>
</body>
</html>
Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Assignment
{
public partial class ReverseNumberBetween : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="txtNumberStart" runat="server"></asp:TextBox><br />
<asp:TextBox ID="txtNumberEnd" runat="server"></asp:TextBox><br />
<asp:Button ID="btnArm" runat="server" Text="Armstrong Number"
OnClick="btnArm_Click" /><br />
<asp:ListBox ID="ListBox1" runat="server" Width="360px"></asp:ListBox>
</div>
</form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Assignment
{
public partial class ArmstrongNumber : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="txtNumber" runat="server"></asp:TextBox><br />
<asp:Button ID="btnReverse" runat="server" Text="Palindrom Number"
OnClick="btnReverse_Click" /><br />
<asp:Label ID="lblResult" runat="server" Text="0"></asp:Label>
</div>
</form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Assignment
{
public partial class Palindrom : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="Enter Number of
Rows"></asp:Label><br />
<asp:TextBox ID="txtNumber" runat="server" Text="0"></asp:TextBox><br />
<asp:Button ID="btnDraw" runat="server" Text="Draw"
OnClick="btnDraw_Click" /><br />
<asp:Label ID="lblResult" runat="server" ></asp:Label>
</div>
</form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Assignment
{
public partial class Triangle1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="Enter Number of
Rows"></asp:Label><br />
<asp:TextBox ID="txtNumber" runat="server" Text="0"></asp:TextBox><br />
<asp:Button ID="btnDraw" runat="server" Text="Draw"
OnClick="btnDraw_Click" /><br />
<asp:Label ID="lblResult" runat="server" ></asp:Label>
</div>
</form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Assignment
{
public partial class Triangle1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{