You are on page 1of 4

Name: DHRUVNARAYAN RAWAL

SUBJECT: ASP.NET
ENROLLMENT NO:IU2082820063
SEMESTER:VI
BRANCH: IMCA
Q1> Write a console program to perform Fibonacci series from 1 to 100.
namespace ASSIGNMENT_I_PG1
{
class Program
{
static void Main(string[] args)
{
int val1 = 0, val2 = 1, val3, i, n;
n = 7;
Console.WriteLine("Fibonacci Series:");
Console.Write(val1 + " " + val2 + " ");
for (i= 2; i < n; ++i)
{
val3 = val1 + val2;
Console.Write(val3 + " ");
val1 = val2;
val2 = val3;
Console.Read();
}
}
}
}

OUTPUT

Q2> Write a console application to perform pyramid pattern.


namespace ASSIGNMENT_I_PG2
{
class Program
{
static void Main(string[] args)
{
int x = 6;
for (int i = 1; i <= x; i++)
{

for (int j = 1; j <= (x - i); j++)


Console.Write(" ");

//loop to print stars


for (int t = 1; t < i * 2; t++)
Console.Write("*");
Console.WriteLine();
Name: DHRUVNARAYAN RAWAL
SUBJECT: ASP.NET
ENROLLMENT NO:IU2082820063
SEMESTER:VI
BRANCH: IMCA
}
Console.ReadLine();
}
}
}

OUTPUT

Q3> Create a web form to perform registration & login.


<!DOCTYPE html>
<html>
<head>
<title>Registration and Login Form</title>
</head>
<body>
<h1>Registration Form</h1>
<form method="post" action="Register.aspx">
<label>Username:</label>
<input type="text" name="username" required /><br /><br />
<label>Password:</label>
<input type="password" name="password" required /><br /><br />
<label>Confirm Password:</label>
<input type="password" name="confirmPassword" required /><br /><br />
<input type="submit" value="Register" />
</form>

<h1>Login Form</h1>
<form method="post" action="Login.aspx">
<label>Username:</label>
<input type="text" name="username" required /><br /><br />
<label>Password:</label>
<input type="password" name="password" required /><br /><br />
<input type="submit" value="Login" />
</form>
</body>
</html>

OUTPUT
Name: DHRUVNARAYAN RAWAL
SUBJECT: ASP.NET
ENROLLMENT NO:IU2082820063
SEMESTER:VI
BRANCH: IMCA

Q4>Create an application to take response from user and print it.


using System;

namespace programm4
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Please enter your response:");

string response = System.Console.ReadLine();

Console.WriteLine($"You entered: {response}");

Console.Read();
}
}
}

OUTPUT
Name: DHRUVNARAYAN RAWAL
SUBJECT: ASP.NET
ENROLLMENT NO:IU2082820063
SEMESTER:VI
BRANCH: IMCA
Q5> Create a form to perform different types of lists and print the response.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherit
s="WebApplication1.WebForm1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<label for="listType">Type of list:</label>
<select id="listType" name="listType">
<option value="ul">Unordered List</option>
<option value="ol">Ordered List</option>
<option value="dl">Definition List</option>
</select>
<br />
<label for="listItems">List items:</label>
<textarea id="listItems" name="listItems"></textarea>
<br />
<button type="submit">Submit</button>
<button type="reset">Reset</button>
<br />
<label id="listOutput"></label>
</div>
</form>
</body>
</html>

OUTPUT

You might also like