Write A Program in C# To Compute The Area of Circle.: Source Code

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 42

1 Write a program in C# to compute the area of circle.

Source Code:

using System;
namespace Lab1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("enter the value of radius");
double r = double.Parse(Console.ReadLine());
double pi = 22 / 7;
double area = pi * r * r;
Console.WriteLine("Area is :" + area);
}
}
}

Output:

1
2 Write a program to compare three numbers and find the difference between the
greatest and smallest numbers.
Source Code:
using System;
namespace lab2
{
class Program
{
static void Main(string[] args)
{
int firstNum;
int secNum;
int thirdNum;
Console.WriteLine("Enter First number");
firstNum = int.Parse(Console.ReadLine());
Console.WriteLine("Enter Second number");
secNum = int.Parse(Console.ReadLine());
Console.WriteLine("Enter Third number");
thirdNum = int.Parse(Console.ReadLine());
Lab d = new Lab();
int difference = d.CompareNumbers(firstNum, secNum, thirdNum);
Console.WriteLine("the difference between greatest and smallest is: " +
difference);
}
}
class Lab
{
public int CompareNumbers(int first, int second, int third)
{
int greatestnumber;
int smallestnumber;
if (first > second && first > third)
{
greatestnumber = first;
}
else if (second > first && second > third)
{
greatestnumber = second;
}
else
{

2
greatestnumber = third;
}
if (first < second && first < third)
{
smallestnumber = first;
}
else if (second < first && second < third)
{
smallestnumber = second;
}
else
{
smallestnumber = third;
}
return greatestnumber - smallestnumber;
}
}
}

Output:

3
3 Write a program to find the series of Fibonacci series.
Source Code:

using System;
namespace lab4
{
class Program
{
public static void Main(string[] args)
{
int n1 = 0, n2 = 1, n3, i, number;
Console.Write("Enter the number of elements: ");
number = int.Parse(Console.ReadLine());
Console.Write(n1 + " " + n2 + " ");
for (i = 2; i < number; ++i)
{
n3 = n1 + n2;
Console.Write(n3 + " ");
n1 = n2;
n2 = n3;
}
}
}
}

Output:

4
4 Write a program to identify whether an input number is prime or not.
Source Code:

using System;
namespace lab5
{
class Program
{
static void Main(string[] args)
{
int a = 0;
Console.WriteLine("enter the number");
int number = int.Parse(Console.ReadLine());
for (int i = 1; i <= number; i++)
{
if (number % i == 0)
{
a++;
}
}
if (a == 2)
{
Console.WriteLine("{0} is a Prime Number", number);
}
else
{
Console.WriteLine(" {0} is Not a Prime Number", number);
}
}
}
}

5
5 Write a program to input an array of 8 numbers and find the maximum
and minimum value in that array.
Source Code:

using System;
namespace lab6
{
class Program
{
static void Main(string[] args)
{
int[] arr = new int[8] { 1, 2, 3, 4, 5, 6, 7, 8 }; int i, max, min, n;
n = 8;
max = arr[0];
min = arr[0];
for (i = 1; i < n; i++)
{
if (arr[i] > max)
{
max = arr[i];
}
if (arr[i] < min)
{
min = arr[i];
}
}
Console.Write("Maximum element = {0}\n", max);
Console.Write("Minimum element = {0}\n\n", min);
}
}
}

6
6 Write a program to display a four-by-four identity matrix.

Source Code:
namespace lab8
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter the order: ");
int n = int.Parse(Console.ReadLine());
int[,] a = new int[3, 3];
int i, j;
Console.WriteLine("\n Enter the matrix\n");
for (i = 0; i < n; i++)
{
for (j = 0; j < n; j++)
{
a[i, j] = Convert.ToInt16(Console.ReadLine());
}
}
for (i = 0; i < 3; i++)
{
for (j = 0; j < 3; j++)
{
if ((i == j && a[i, j] != 1) || (i != j && a[i, j] != 0))
{
goto label;
}
}
}
Console.WriteLine("Identity Matrix");
return;
label:
Console.WriteLine("\n Not an Identity Matrix");
}
}
}

7
Output:

7 Create the following jagged array and display its elements:


5, 7, 1
3, 1, 4, 6, 7
1, 3, 6, 2
Source Code:

using System;
namespace lab9
{
class Program
{
static void Main(string[] args)
{
int[][] jagged_arr = new int[3][];
// Initialize the elements
jagged_arr[0] = new int[] { 5, 7, 1 };
jagged_arr[1] = new int[] { 3, 1, 4, 6, 7 };
jagged_arr[2] = new int[] { 1, 3, 6, 2 };
// Display the array elements:
for (int n = 0; n < jagged_arr.Length; n++)
{
// Print the row number
System.Console.Write("Row({0}): ", n);
for (int k = 0; k < jagged_arr[n].Length; k++)
{
// Print the elements in the row

8
System.Console.Write("{0} ", jagged_arr[n][k]);
}
System.Console.WriteLine();
}
}
}
}
Output:

8 Write a program to create a two-dimensional array and convert it into one


dimensional array.
Source Code:
using System;
namespace lab
{
class Program
{
int row, col;
int[,] TwoD;
int[] OneD;
Program(int r, int c)
{
row = r;
col = c;
TwoD = new int[row, col];
OneD = new int[row * col];
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)

9
{
TwoD[i, j] = i + j;
}
}
}
public void ConvertTwoDArrayToOneDArray()
{
int index = 0;
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
OneD[index++] = TwoD[i, j];
}
}
}
public void PrintTwoArray()
{
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
Console.Write(TwoD[i, j] + "\t");
}
Console.WriteLine();
}
}
public void PrintOneDArray()
{
for (int i = 0; i < row * col; i++)
{
Console.WriteLine(OneD[i]);
}
}
public static void Main(string[] args)
{
Program D = new Program(2, 2);
Console.WriteLine("TwoD Array(Matrix) is: ");
D.PrintTwoArray();
D.ConvertTwoDArrayToOneDArray();
Console.WriteLine("OneD Array after conversion: ");

10
D.PrintOneDArray();
}
}
}
Output:

9 Write a program to create a two-dimensional array with 3 rows and 3


columns and find the sum of its diagonal elements.
Source Code:

using System;
namespace lab11
{
class Program
{
static void Main(string[] args)
{
//Initialize matrix a
int[,] a = {{1, 2, 3},{4, 5, 6},{7, 8, 9}};
//Initialize matrix b
int[,] b = {{1, 4, 7},{2, 5, 8},{3, 6, 9}};
//Calculates number of rows and columns present in given matrix
int rows = a.GetLength(0);
int cols = a.GetLength(1);
//Array sum will hold the result
int[,] sum = new int[3, 3];
//Performs addition of matrices a and b. Store the result in matrix sum
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)

11
{
sum[i, j] = a[i, j] + b[i, j];
}
}
Console.WriteLine("Addition of two matrices: ");
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < cols; j++)
{
Console.Write(sum[i, j] + " ");
}
Console.WriteLine();
}
}
}
}
Source Code:

10 Create a class with name Interest that contains three instance variables
principal, time and rate and also contains a method named
computeInterest to calculate simple interest. Use this method in another
class InterestCompute to compute simple interest.
Source Code:

using System;
namespace lab13
{
class Program
{
static void Main(string[] args)

12
{
Console.WriteLine("Enter principal");
int a = int.Parse(Console.ReadLine());
Console.WriteLine("Enter time");
int b = int.Parse(Console.ReadLine());
Console.WriteLine("Enter rate");
int e = int.Parse(Console.ReadLine());
InterestCompute c = new InterestCompute();
int d = c.callInterest(a, b, e);
Console.WriteLine("the interest is" + d);
}
}
class InterestCompute : Interest
{
public int callInterest(int a, int b, int c)
{
int interest = 0;
Interest compute1 = new Interest();
interest = compute1.computeInterest(a, b, c);
return interest;
}
}
class Interest
{
public int principal { get; set; }
public int time { get; set; }
public int rate { get; set; }
public int computeInterest(int principal, int time, int rate)
{
return (principal * time * rate) / 100;
}
}
}

13
Output:

11 Create a class with name Computation that contains a method named


sum() that calculates the sum of two numbers by using parameter passing.
Create another class ComputationImp that uses this method for sum
calculation by creating two objects of it.

Source Code:
using System;
namespace lab14
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter two numbers");
int a = int.Parse(Console.ReadLine());
int b = int.Parse(Console.ReadLine());
Computationimp c = new Computationimp();
int d = c.callsum(a, b);
Console.WriteLine("the sum is " + d);
}
}
class Computation
{
public int sum(int a, int b)
{
return (a + b);

14
}
}
class Computationimp : Computation
{
public int callsum(int a, int b)
{
int sum = 0;
Computation compute1 = new Computation();
sum = compute1.sum(a, b);
return sum;
}
}
}

Output:

12 WAP that has overloaded methods. The first method should accept no
arguments and displays a text in it, the second method will accept one
string and third method will accept a string and integer.

Source Code:
using System;
namespace _03_assignment
{
class Program
{

15
public void add()
{
Console.WriteLine("no argument");
}
public void add(string s1)
{
Console.WriteLine(s1 );
}
public void add(string s2, int s3)
{
Console.WriteLine(s2 + s3);
}

static void Main(string[] args)


{
Program obj = new Program();
obj.add();
obj.add("pranaya");
obj.add("sad", 20);
Console.WriteLine("Press any key to exist.");
Console.ReadKey();
}
}
}

Output:

13 WAP that has a default constructor which initializes the variables to 10, 25
and 30 and a parameterized constructor with the method that displays the
values of those variable.

Source Code:
using System;

16
namespace _03_assignment
{
class Program
{
int n1, n2,n3;
public Program()
{
n1=10;
n2=25;
n3=30;
}
public Program(int n1, int n2, int n3)
{
this.n1 =n1;
this.n2= n2;
this.n3 = n3;
}

public void compute()


{

Console.WriteLine("first num is "+ n1 );


Console.WriteLine("Second num is " + n2);
Console.WriteLine("Third num is " + n3);
}
}
class BoxImp
{static void Main(string[] args)
{
Program b1=new Program();
b1.compute();
}
}
}

17
Output:

14 Create a class Compute Interest that has a method to compute simple


interest which takes three parameters principal, time and rate.

Source Code:
Source code:
using System;
namespace _03_assignment
{
class ComputeInterest
{
public void compute(int p,int t,int r)
{

int i = (p * t * r) / 100;
Console.WriteLine("Simple interest is "+ i );
} }
}
class BoxImp
{static void Main(string[] args)
{
ComputeInterest b1=new ComputeInterest();
b1.compute(200,2,2);

}
}
}

18
Output:

15 Create a class Point that has two instance variables x and y coordinates
and a constructor that initializes them. Also it should contain a method to
display values of these variables. Create a sub class named Point3d that
also contains the new variable z coordinate and display them like in parent
class.

Source Code:
Source code:
using System;

namespace Program
{
class Point
{
public int x, y;
public Point(int x, int y)
{
this.x = x;
this.y = y;
}
public void Display01()
{
Console.WriteLine("First variable is {0}", x);
Console.WriteLine("Second variable is {0}", y);
}
}
class Point3d :Point
{
protected int z;
public Point3d(int x, int y, int z) : base(x,y)
{
this.z = z;

19
}
public void Display02()
{
Console.WriteLine("First variable is {0}", x);
Console.WriteLine("Second variable is {0}",y);
Console.WriteLine("Third variable is {0}",z);
}
}
class CalculateImp
{
static void Main(string[] args)
{
Point3d cal = new Point3d(12, 10, 5);
cal.Display01();
cal.Display02();
}
}
}

Output:

16 Create a base class called Circle. It should contain getter and setter
methods for private instance variable radius and also a method to
calculate and display area of the circle.

Source Code:
using System;
namespace _03_assignment
{
class Circle
{
public int rad { get; set; }

public void area() {

20
double a = (3.14)*rad*rad;
Console.WriteLine("Area is {0}", a);
}
}
class CalculateNew : Circle
{

public void volume()


{
int v = (4/3)*rad*rad*rad;
Console.WriteLine("Volume is {0}", v);
}
}
class CalculateImp
{
static void Main(string[] args)
{
CalculateNew cal = new CalculateNew();
cal.rad= 12;
cal.area();
cal.volume();
}
}
}

Output:

21
17 Create a class Customer that has a static variable to count the transactions
and three instance variables name, address and age. Create a static
method to increment the count of transaction. Also create two methods,
first one to set the values of name, address and age to their respective
instance variables and second one to display the values of all four
variables. Create another class CustomerImp in which add the
information of three customers with incrementing the count of
transactions each time and also display the output.

Source Code:
using System;

namespace _04_Assignment
{
class Customer
{
public static int count = 0;
string name;
string address;
int age;
static void Inc()
{
count++;
}
public void Setvalue(string name, string address, int age)
{
this.name = name;
this.address = address;
this.age = age;

}
public void Display()
{
Console.WriteLine(" -> Given name is:" + name);
Console.WriteLine(" -> Given address is:" + address);
Console.WriteLine(" -> Given age is:" + age);
Console.WriteLine(" -> Total number of count is:" + count);

22
class CustomerImp
{
public static int Cus_count = 1;
string Cus_name;
string Cus_address;
int Cus_age;
public void SetInfo(string Cus_name, string Cus_address, int Cus_age)
{
this.Cus_name = Cus_name;
this.Cus_address = Cus_address;
this.Cus_age = Cus_age;
Console.WriteLine("Information of first customer :" + "->name: " + Cus_name +
"-> address: " + Cus_address + "-> Age: " + Cus_age);
Console.WriteLine("Information of Second customer :" + "->name: " +
Cus_name + "-> address: " + Cus_address + "-> Age: " + Cus_age);
Console.WriteLine("Information of third customer :" + "->name: " + Cus_name +
"-> address: " + Cus_address + "-> Age: " + Cus_age);
Console.WriteLine(" -> Total number of count is:" + Cus_count);

Cus_count++;
}
}
static void Main(string[] args)
{
Customer eim = new Customer();
eim.Setvalue("saloni", "ith", 19);
eim.Display();
Inc();

CustomerImp inn = new CustomerImp();


inn.SetInfo("sal","yon",09);
inn.SetInfo("sal", "yon", 09);
inn.SetInfo("sal", "yon", 09);
}
}
}

Output:

23
18 Create a class named Student that has three instance variables name,
address and age. Also create a parameterized constructor to initialize
them and a virtual method to display their values.
Create its subclass NewStudent that has an instance variable Student code
of string type. Add a parameterized constructor in it and also override the
display method that displays all the values.
Create any two objects in a class NewStudentImp.

Source Code:
using System;

namespace Std
{
public class Student
{
public string name;
public string address;
public int age;
public Student(string name, string address, int age)
{
this.name = name;
this.address = address;
this.age = age;

24
}
public virtual void display()
{
Console.WriteLine("name is:" + name);
Console.WriteLine("address is:" + address);
Console.WriteLine("age is:" + age);
}

}
class NewStudent : Student
{
string Std_code;
public NewStudent(string name, string address, int age, string Std_code) : base(name,
address, age)
{
this.Std_code = Std_code;

}
public override void display()
{
Console.WriteLine("name is:" + name);
Console.WriteLine("address is:" + address);
Console.WriteLine("age is:" + age);
Console.WriteLine("student cose is:" + Std_code);

}
}
public class Imp
{
static void Main(string[] args)
{
NewStudent e1 = new NewStudent("sat", "add", 1,"sin");
e1.display();
}
}
}

25
Output:

19 Create a class Point that has three instance variables x, y and z. Perform
the operator overloading for finding the products of these points.

Source Code:
namespace Std
{
class Point
{
public int x, y,z;
public Point(int x, int y, int z)
{
this.x = x;
this.y = y;
this.z = z;
}
public static Point operator *(Point p1, Point p2)
{
Point p = new Point(0,0,0);
p.x = p1.x * p2.x;
p.y = p1.y * p2.y;
p.z = p1.z * p2.z;
return p;
}
}
class PointImp
{
static void Main(string[] args)
{
Point p1 = new Point(10, 11,2);
Point p2 = new Point(1, 2,3);
Point p3 = p1 * p2;
Console.WriteLine("x:{0} ,y:{1} and z:{2}", p3.x, p3.y,p3.z);
26
}
}
}

Output:

20 Create a class that contains a method to find the average of variable length
arguments using params. Also create an object of it and find the average
of three numbers, four numbers and five numbers by passing the values.

Source Code:
using System;
class Test {
public void computeSum(params int[] num)
{
float sum = 0;
for (int i = 0; i < num.Length; i++)
sum += num[i];
float avg = sum / num.Length;
Console.WriteLine("Sum is {0}", sum);
Console.WriteLine("avg is {0}", avg);
}
}
class TextImp {
static void Main(string[] args)
{
Test t = new Test();
t.computeSum(5, 5);
t.computeSum(1, 1, 1);
t.computeSum(2, 2, 2, 2);
}
}

27
Output:

21 Create an interface named Compute that contains the three methods, first
method sets the value of radius, second method computes area and then
third method computes circumference. Implement the interface in the
class Circle and display the results.

Source Code:
using System;
interface Compute{
void setRadius(double a);
double area();
double circumference();
}
class Circle : Compute {
private double radius;
public void setRadius(double a){
this.radius = a;
}
public double area(){
return Math.PI * this.radius * this.radius;
}
public double circumference(){
return 2 * Math.PI * this.radius;
}
public override string ToString(){
return "on radius of circle " + this.radius + ", area=" + this.area() + ", circumference=" +
this.circumference();
}
}
public class Program1{
public static void Main(string[] args){
Circle c = new Circle();
c.setRadius(12);

28
Console.WriteLine(c);
}
}

Output:

22 Write a program to create an abstract class for Student class consisting


the methods setInfo() with parameters name and age that sets the
parameter value to the variables in the same abstract class. Add abstract
methods display() for showing the results and reset() for resetting the
values. Create a class StudentImp that sets the values to be “Ram” and 25
and display them. Reset the values and change the name and age to be
“Sudha” and 23 for the same object and display them.

Source Code:
using System;
abstract class Student{
protected string name;
protected int age;
public void setInfo(string name, int age){
this.age = age;
this.name = name;
}
public abstract void display();
public abstract void reset();
}

class StudentImp : Student{


public StudentImp(){

29
this.setInfo("Ram", 25);
}
public override void display(){
Console.WriteLine("name={0}, age={1}", this.name, this.age);
}
public override void reset(){
this.setInfo("Sudha", 23);
}
public static void Main(){
StudentImp std = new StudentImp();
std.display();
std.reset();
std.display();
}
}

Output:

23 Create a struct with name Box that contains variables length, breadth and
height and two methods for computing area and volume. Create any two
objects of it in a class named BoxImp.

Source Code:
using System;

struct Box{
private double length;
private double breadth;
private double height;
public Box(double length, double breadth, double height){

30
this.length = length;
this.breadth = breadth;
this.height = height;
}
public double area(){
return (2 * (this.height * this.breadth)) + (2 * (this.height * this.length)) + (2 *
(this.breadth * this.length));
}
public double volume(){
return this.length * this.height * this.breadth;
}
}
class BoxImp{
public static void Main(string[] args){
Box box1 = new Box(1, 2, 3);
Console.WriteLine("area={0}, volume={1}", box1.area(), box1.volume());
Box box2 = new Box(4, 5, 6);
Console.WriteLine("area={0}, volume={1}", box2.area(), box2.volume());
}
}

Output:

31
24 Perform the same operation of Question 3 using properties in the struct.

Source Code:
using System;

struct Box{
public double length{get; set;}
public double breadth{get; set;}
public double height{get; set;}
public double area(){
return (2 * (this.height * this.breadth)) + (2 * (this.height * this.length)) + (2 *
(this.breadth * this.length));
}
public double volume(){
return this.length * this.height * this.breadth;
}
}
class Program4{
public static void Main(string[] args){
Box box1 = new Box();
box1.breadth = 1;
box1.length = 2;
box1.height = 3;
Console.WriteLine("area={0}, volume={1}", box1.area(), box1.volume());
Box box2 = new Box();
box2.breadth = 4;
box2.length = 5;
box2.height = 6;
Console.WriteLine("area={0}, volume={1}", box2.area(), box2.volume());
}
}

Output:

32
25 Create an enumeration named Subjects that contains the list of the
subjects that you study in this semester and this their values.

Source Code:
using System;
class Test{
enum Subjects{
DOT_NET = 1,
GRAPHICS = 2,
MANAGEMENT = 3,
NETWORKING = 4,
MIS = 5,
};
public static void Main(string[] args){

}
}

33
26 Create the following delegate:
delegate int Computation(int x, int y) and use it to access any five methods.
(Example: sum, subtract, product, division, modular division, power)

Source Code:
using System;
delegate int Computation(int x, int y);
class delegateExample{
public static void Main(string[] args){
Computation a = sum;
Console.WriteLine(a(1, 3));
a = subtract;
Console.WriteLine(a(1, 3));
a = product;
Console.WriteLine(a(1, 3));
a = division;
Console.WriteLine(a(25, 5));
a = shift;
Console.WriteLine(a(15, 3));
}
public static int sum(int x, int y){
return x + y;
}
public static int subtract(int x, int y){
return x - y;
}
public static int product(int x, int y){
return x * y;
}
public static int division(int x, int y){
return x / y;
}
public static int shift(int x, int y){
return x >> y;
}
}

34
Output:

27 Create a multicast delegate to invoke two instance methods for division


and modular division.

Source Code:
using System;
delegate double Something(double a, double b);
class Program7{
public static void Main(string[] args){
Something a = division;
a += modularDivision;
Console.WriteLine(a(234,54));
}
public static double division(double a, double b){
return a / b;
}
public static double modularDivision(double a, double b){
return a % b;
}
}

35
Output:

28 Write a program that contains a delegate for invoking the methods with
the method signature:
int method-name(int x)
Create a method to find the cube of a number and a plugin method with
delegates that should display the list of cubes from sequence 1 to 5.

Source Code:
using System;
delegate int methodName(int a);
class Plugin{
public static void Main(string[] args){
SquareData(5, new methodName(cube));
}
public static void SquareData(int n, methodName method){
for(int i=1; i<=n; i++){
Console.WriteLine("cube of {0} = {1}", i, method(i));
}
}
public static int cube(int a){
return a * a * a;
}
}

36
Output:

29 Write a program that uses an array to store a numeric data in specific


array location(index) chosen by the user and also implement an exception
handling block that uses ArrayTypeMismatchException and
IndexOutOfRangeException.

Source Code:
using System;
class asd{
public static void Main(string[] args){
int[] a = new int[5];

Console.Write("Enter index:");
int index = Convert.ToInt32(Console.ReadLine());
Console.Write("Enter number to be stored on index[{0}]:", index);
int number = Convert.ToInt32(Console.ReadLine());
try{
a[index] = number;
Console.WriteLine("Number Stored");
}catch(ArrayTypeMismatchException e){
Console.WriteLine("ArrayTypeMismatchException occured!!");
}catch(IndexOutOfRangeException e){
Console.WriteLine("IndexOutOfRangeException occured!!");
}
}
}

37
Output:

30 Write a GUI program to find sum of two number.

Source Code:
namespace DotNetGUI
{
public partial class FrmSumOfTwoNumber : Form
{

{
InitializeComponent();
}
private void btnCalculate_Click(object sender, EventArgs e)
{
int a = Convert.ToInt32(txtNum1.Text);
int b = Convert.ToInt32(txtNum2.Text);
int c = a + b;
txtResult.Text = c.ToString();
}
}
}

38
Output:

31 Write GUI Program to Calculate Simple Interest.

Source Code:
namespace DotNetGUI
{
public partial class FrmCalculateSimpleInterest : Form
{
public FrmCalculateSimpleInterest()
{
InitializeComponent();
}

private void btnCalculate_Click(object sender, EventArgs e)


{
int a = Convert.ToInt32(txtPrincipal.Text);
int b = Convert.ToInt32(txtTime.Text);
int c = Convert.ToInt32(txtRate.Text);
int s = (a *b*c)/100;
txtInterest.Text = s.ToString();
}
}
}

39
Output:

32 Write GUI Program to create a registration form.

Source Code:
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table class="auto-style1">
<tr>
<td>Name :</td>
<td>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</td>

</tr>
<tr>
<td>Password</td>
<td> <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox></td>
</tr>
<tr>

40
<td>Confirm Password</td>
<td>
<asp:TextBox ID="TextBox3" runat="server"
TextMode="Password"></asp:TextBox>
</td>
</tr>
<tr>
<td>City</td>
<td>
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem Text="Select City" Value="select"
Selected="True"></asp:ListItem>
<asp:ListItem Text="Bangalore" Value="Bangalore"></asp:ListItem>
<asp:ListItem Text="Mysore" Value="Mysore"></asp:ListItem>
<asp:ListItem Text="Hubli" Value="hubli"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>Gender</td>
<td>
<asp:RadioButtonList ID="RadioButtonList1" runat="server">
<asp:ListItem>Male</asp:ListItem>
<asp:ListItem>Female</asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
<tr>
<td>Gmail</td>
<td>
<asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Button ID="Button1" runat="server" Text="Button" />
</td>
</tr>
</table>
</div>
</form>

41
</body>
</html>

Output:

42

You might also like