Dot Net Framework
A)
Write a Menu driven program in C#.Net to perform following functionality:
Addition,
Multiplication, Subtraction, Division.
Answer :
namespace WinFormsApp18
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void addtionToolStripMenuItem_Click(object sender, EventArgs e)
{
int a = Convert.ToInt32(textBox1.Text);
int b = Convert.ToInt32(textBox2.Text);
int c = a+b;
label3.Text = "+";
label5.Text = c.ToString();
}
private void substractionToolStripMenuItem_Click(object sender, EventArgs e)
{
int a = Convert.ToInt32(textBox1.Text);
int b = Convert.ToInt32(textBox2.Text);
int c = a - b;
label3.Text = "-";
label5.Text = c.ToString();
}
private void divisonToolStripMenuItem_Click(object sender, EventArgs e)
{
int a = Convert.ToInt32(textBox1.Text);
int b = Convert.ToInt32(textBox2.Text);
int c = a / b;
label3.Text = "/";
label5.Text = c.ToString();
}
private void multiplicationToolStripMenuItem_Click(object sender, EventArgs e)
{
int a = Convert.ToInt32(textBox1.Text);
int b = Convert.ToInt32(textBox2.Text);
int c = a * b;
label3.Text = "*";
label5.Text = c.ToString();
}
}
}
Output :
B)
Create an application in ASP.Net that allows the user to enter a number in the
textbox
named "getnum". Check whether the number in the textbox
"getnum" is
palindrome
or not. Print the message accordingly in the label control named lbldisplay
when
the user clicks on the button "check".
Answer :
Output :
No comments:
Post a Comment