SlideShare a Scribd company logo
STAR ACADEMY OF TECHNOLOGY AND MANAGEMENT
INDORE
COMPUTER SCIENCE & ENGINEERING
DOTNET TECNOLOGY(CS-406)
LAB MANUAL
Submitted By :
Name : RANJIT KUMAR NAHAK
Session : Jan 2014-Jun 2014
Dept. : CSE, SATM
1) W.A.P to perform basic arithmetic calculation.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace add
{
class Program
{
static void Main(string[] args)
{
int a, b;
Console.WriteLine("Enter first nos.");
a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter second no.");
b = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("add is :{0}", a + b);
Console.WriteLine("sub is :{0}",a-b);
Console.WriteLine("multiis :{0}",a*b);
Console.WriteLine("devi is :{0}",a/b);
Console.ReadLine();
}
}
}
OUTPUT
2) W.A.P to interchange the value of 2 variables without using third variable.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace swap
{
class Program
{
static void Main(string[] args)
int a = 6;
int b = 7;
Console.WriteLine("the numbers before swapping a={0} and b={1}",a,b);
a = a + b;
b = a - b;
a = a - b;
Console.WriteLine("the numbers after swapping a={0} and b={1}", a,
b); Console.Read();
}
}
}
OUTPUT
3) W.A.P to display array elements & their sum.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace array
{
class Program
{
static void Main(string[] args)
{
int[] num = { 10, 20, 30, 40 }; int n =
num.Length; Console.WriteLine("array
elements"); for (int i = 0; i < n; i++)
{ Console.WriteLine(num[i]);
}
int sum = 0;
for (int i = 0; i < n; i++)
{ sum = sum + num[i];
} Console.WriteLine("sum"+sum);
Console.Read();
}
}
}
OUTPUT
4) W.A.P to input array elements & sort them.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace arrayip
{
class Program
{
static void Main(string[] args)
int i, j, temp;
int[] ar = new int[5];
Console.WriteLine("Enter the elements of array");
for (i = 0; i < ar.Length; i++)
{
ar[i] = Convert.ToInt32(Console.ReadLine());
}
Console.WriteLine("Sorted array is: ");
{
for (i = 0; i < ar.Length; i++)
{
for (j = i + 1; j < ar.Length; j++)
{
if (ar[i] > ar[j])
{
temp = ar[i]; ar[i] =
ar[j]; ar[j] = temp;
}
}
}
for (i = 0; i < ar.Length; i++)
{
Console.Write(ar[i]);
Console.ReadLine();
}
}
}
}}
OUTPUT
5) W.A.P using c lass.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace
{
class Program
{
class student
{
String nm, dep, gen;
public void setdata()
{
Console.WriteLine("Eter Name"); nm =
Console.ReadLine();
Console.WriteLine("Enter Dept"); dep =
Console.ReadLine();
Console.WriteLine("Enter gender"); gen =
Console.ReadLine();
}
public void putdata()
{
Console.WriteLine("Name " +nm);
Console.WriteLine("DEPT " +dep);
Console.WriteLine("Gender " +gen);
}
}
static void Main(string[] args)
{
student stu = new student();
stu.setdata(); stu.putdata();
Console.ReadLine();
}
}
}
OUTPUT
6) W.A.P to print fibonacci series.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace fibonic_series
{
class Program
{
static void Main(string[] args)
{
int a, b, c,n;
a=0;
b=1;
Console.WriteLine("Enter Limit: ");
n =
Convert.ToInt32(Console.ReadLi
ne()); Console.WriteLine( a);
Console.WriteLine( b);
for(int i=3;i<=n;i++)
{
c = a + b;
a = b; b = c;
Console.Writ
eLine(c);
}
Console.ReadLine();
}
}
}
OUTPUT
7) W.A.P using function overloading.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace funover
{
class Program
{
class worker
{
public void salary(int a, int b)
{
int total, bonus;
Console.Write("Enter first bonus: ");
bonus = Convert.ToInt32(Console.ReadLine());
total = bonus + a + b; Console.WriteLine();
Console.WriteLine("Total salary is: "+total);
Console.WriteLine();
}
public void salary(int a)
{
int total, bonus;
Console.Write("Enter second bonus: ");
bonus = Convert.ToInt32(Console.ReadLine());
total = bonus + a; Console.WriteLine();
Console.WriteLine("Total salary is: "+total);
}
}
static void Main(string[] args)
{
worker w = new worker();
w.salary(5000,6000);
w.salary(10000);
Console.ReadLine();
}
}
}
OUTPUT
8) W.A.P to show multilevel inheritance.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace multiinhrit
{
class Area
{
public int l, b;
public void cal_area()
{
Console.WriteLine();
Console.WriteLine("The area is:(l*b) " + (l * b));
}
}
class volume : Area
{
public int h;
public void cal_volume()
{
Console.WriteLine();
Console.WriteLine("The volume is: " + (l * b * h));
}
}
class density : volume
{
int m;
public density(int ll, int bb, int hh, int mm)
{
l = ll;
b = bb;
h = hh;
m = mm;
}
public void cal_density()
{
int d;
d = m / (l * b * h); Console.WriteLine();
Console.WriteLine("The density is: " + d);
}
public void showdata()
{
Console.WriteLine("The length is: " + l);
Console.WriteLine();
Console.WriteLine("The breadth is: " + b);
Console.WriteLine();
Console.WriteLine("The height is: " + h);
Console.WriteLine();
Console.WriteLine("The mass is: " + m);
}
}
class Program
{
static void Main(string[] args)
density dense = new density(12,10,5,4000);
dense.showdata();
dense.cal_volume();
dense.cal_area();
dense.cal_
density();
Console.R
ead();
}
}
}
OUTPUT
9) W.A.P to print star pyramid.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace star
{
class Program
{
static void Main(string[] args)
{
int i,j;
Console.WriteLine("pyramid of star:");
for (i = 0; i <= 5; i++)
{
for (j = 0; j < i; j++)
{
Console.Write("*");
}
Console.WriteLine();
}
Console.ReadLine();
}
}
}
OUTPUT
WINDOWS PROGRAMMING
10) W.a.P to print the factorial of a given no.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace fact
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int n,i,fact=1;
n = Convert.ToInt32(textBox1.Text);
for (i = 1; i <= n; i++)
{
fact = fact * i;
}
textBox2.Text = Convert.ToString(fact);
}
OUTPUT
11) W.A.P to find the greatest of three nos.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace greatest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int a, b, c;
a = Convert.ToInt32(textBox1.Text);
b = Convert.ToInt32(textBox2.Text);
c = Convert.ToInt32(textBox3.Text);
if (a > b && a > c)
{
MessageBox.Show("A is Greatest");
}
else
{
if (b > c)
{
MessageBox.Show("B is Gratest");
}
else
{
MessageBox.Show("C is Greatest");
}
}
textBox1.Text
= "";
textBox2.Text
= "";
textBox3.Text
= "";
}
}
}
OUTPUT
12) W.A.P to display calculator.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace calc
{
public partial class Form1 : Form
{
String str = "";//globally
String str1 = "";
Double i, j, k,flag=0;
public Form1()
{
InitializeComponent();
}
private void button16_Click(object sender, EventArgs e)
{
textBox1.Text = " ";
textBox2.Text = " ";
str = "";
}
private void button1_Click(object sender, EventArgs e)
{
textBox1.Text =str+ "1";
str = textBox1.Text;
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Text =str+ "2";
str = textBox1.Text;
}
private void button3_Click(object sender, EventArgs e)
{
textBox1.Text = str+"3";
str = textBox1.Text;
}
private void button4_Click(object sender, EventArgs e)
{
textBox1.Text = str+"4";
str = textBox1.Text;
}
private void button5_Click(object sender, EventArgs e)
{
textBox1.Text = str+"5";
str = textBox1.Text;
}
private void button6_Click(object sender, EventArgs e)
{
textBox1.Text = str+"6";
str = textBox1.Text;
}
private void button7_Click(object sender, EventArgs e)
{
textBox1.Text = str+"7";
str = textBox1.Text;
}
private void button8_Click(object sender, EventArgs e)
{
textBox1.Text = str+"8";
str = textBox1.Text;
}
private void button9_Click(object sender, EventArgs e)
{
textBox1.Text = str+"9";
str = textBox1.Text;
}
private void button10_Click(object sender, EventArgs e)
{
textBox1.Text = str+"0";
str = textBox1.Text;
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button11_Click(object sender, EventArgs e)
{
textBox2.Text = textBox1.Text;
textBox1.Text = "";
str = "";
str1 = "+";
}
private void button15_Click(object sender, EventArgs e)
{
i = Convert.ToDouble(textBox2.Text);
j = Convert.ToDouble(textBox1.Text);
if (str1 == "+")
k = i + j;
if (str1 == "-")
k = i - j;
if (str1 == "*")
k = i * j;
if (str1 == "/")
k = i / j;
if (str1 == "%")
k = i % j;
textBox1.Text = k.ToString();
}
private void button12_Click(object sender, EventArgs e)
{
textBox2.Text = textBox1.Text;
textBox1.Text = "";
str = "";
str1 = "-";
}
private void button13_Click(object sender, EventArgs e)
textBox2.Text = textBox1.Text;
str = "";
str1 = "*";
}
private void button14_Click(object sender, EventArgs e)
{
textBox2.Text = textBox1.Text;
textBox1.Text = "";
str = "";
str1 = "/";
}
private void button20_Click(object sender, EventArgs e)
{
textBox2.Text = textBox1.Text;
textBox1.Text = "";
str = "";
str1 = "%";
}
private void button18_Click(object sender, EventArgs e)
{
this.Close();
}
private void button17_Click(object sender, EventArgs e)
{
if (flag == 0)
{
textBox1.Text = str + ".";
str = textBox1.Text;
flag = 1;
}
else
{ str = textBox1.Text;
}
}
13) W.A.P. for Notepad.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace notepad
public partial class Form1 : Form
)
{
public Form1()
{
InitializeComponent();
}
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
//Shows the openFileDialog
openFileDialog1.ShowDialog();
//Reads the text file
System.IO.StreamReader OpenFile = new
System.IO.StreamReader(openFileDialog1.FileName);
//Displays the text file in the textBox
txtMain.Text = OpenFile.ReadToEnd();
//Closes the proccess
OpenFile.Close();
}
private void saveToolStripMenuItem_Click(object sender, EventArgs e)
{
//Determines the text file to save to
System.IO.StreamWriterSaveFile = new
System.IO.StreamWriter(openFileDialog1.FileName);
//Writes the text to the file
SaveFile.WriteLine(txtMain.Text);
//Closes the proccess
SaveFile.Close();
}
private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
{
//Open the saveFileDialog saveFileDialog1.ShowDialog();
//Determines the text file to save to
System.IO.StreamWriterSaveFile = new
System.IO.StreamWriter(saveFileDialog1.FileName);
//Writes the text to the file
SaveFile.WriteLine(txtMain.Text);
//Closes the process
txtMain.Undo();
}
private void redoToolStripMenuItem_Click(object sender, EventArgs e)
{
txtMain.Undo();
}
private void newToolStripMenuItem_Click(object sender, EventArgs
SaveFile.Close();
}
private void printToolStripMenuItem_Click(object sender, EventArgs e)
{
//Declare prntDoc as a new PrintDocument
printDialog1.ShowDialog();
System.Drawing.Printing.PrintDocument prntDoc =
new
System.Drawing.Printing.PrintDocument();
}
private void printPreviewToolStripMenuItem_Click(object sender, EventArgs
e)
{
printPreviewDialog1.ShowDialog();
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void undoToolStripMenuItem_Click(object sender, EventArgs e)
{
e)
{
txtMain.Clear();
}
private void cutToolStripMenuItem_Click(object sender, EventArgs e)
{
}
private void copyToolStripMenuItem_Click(object sender, EventArgs e)
{
txtMain.Copy();
}
private void pasteToolStripMenuItem_Click(object sender, EventArgs e)
{
txtMain.Paste();
}
private void selectAllToolStripMenuItem_Click(object sender, EventArgs e)
{
txtMain.SelectAll();
}
}
}
Dotnet 18
Dotnet 18

More Related Content

What's hot

C# 7.x What's new and what's coming with C# 8
C# 7.x What's new and what's coming with C# 8C# 7.x What's new and what's coming with C# 8
C# 7.x What's new and what's coming with C# 8
Christian Nagel
 
Poor Man's Functional Programming
Poor Man's Functional ProgrammingPoor Man's Functional Programming
Poor Man's Functional Programming
Dmitry Buzdin
 
delegates
delegatesdelegates
delegates
Owais Masood
 
The Ring programming language version 1.5.2 book - Part 7 of 181
The Ring programming language version 1.5.2 book - Part 7 of 181The Ring programming language version 1.5.2 book - Part 7 of 181
The Ring programming language version 1.5.2 book - Part 7 of 181
Mahmoud Samir Fayed
 
Core java pract_sem iii
Core java pract_sem iiiCore java pract_sem iii
Core java pract_sem iii
Niraj Bharambe
 
Martin Fowler's Refactoring Techniques Quick Reference
Martin Fowler's Refactoring Techniques Quick ReferenceMartin Fowler's Refactoring Techniques Quick Reference
Martin Fowler's Refactoring Techniques Quick Reference
Seung-Bum Lee
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
Dmitry Buzdin
 
Odessapy2013 - Graph databases and Python
Odessapy2013 - Graph databases and PythonOdessapy2013 - Graph databases and Python
Odessapy2013 - Graph databases and Python
Max Klymyshyn
 
Java8 stream
Java8 streamJava8 stream
Java8 stream
koji lin
 
Hadoop
HadoopHadoop
DCN Practical
DCN PracticalDCN Practical
DCN Practical
Niraj Bharambe
 
JavaScript Event Loop
JavaScript Event LoopJavaScript Event Loop
JavaScript Event Loop
Designveloper
 
Scala @ TomTom
Scala @ TomTomScala @ TomTom
Scala @ TomTom
Eric Bowman
 
NLP on a Billion Documents: Scalable Machine Learning with Apache Spark
NLP on a Billion Documents: Scalable Machine Learning with Apache SparkNLP on a Billion Documents: Scalable Machine Learning with Apache Spark
NLP on a Billion Documents: Scalable Machine Learning with Apache Spark
Martin Goodson
 
Collection
CollectionCollection
Collection
Gayathri Ganesh
 
Programming with Python and PostgreSQL
Programming with Python and PostgreSQLProgramming with Python and PostgreSQL
Programming with Python and PostgreSQL
Peter Eisentraut
 
Java programs
Java programsJava programs
Java programs
jojeph
 
Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного пр...
Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного пр...Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного пр...
Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного пр...
GeeksLab Odessa
 
java experiments and programs
java experiments and programsjava experiments and programs
java experiments and programs
Karuppaiyaa123
 
If You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongIf You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are Wrong
Mario Fusco
 

What's hot (20)

C# 7.x What's new and what's coming with C# 8
C# 7.x What's new and what's coming with C# 8C# 7.x What's new and what's coming with C# 8
C# 7.x What's new and what's coming with C# 8
 
Poor Man's Functional Programming
Poor Man's Functional ProgrammingPoor Man's Functional Programming
Poor Man's Functional Programming
 
delegates
delegatesdelegates
delegates
 
The Ring programming language version 1.5.2 book - Part 7 of 181
The Ring programming language version 1.5.2 book - Part 7 of 181The Ring programming language version 1.5.2 book - Part 7 of 181
The Ring programming language version 1.5.2 book - Part 7 of 181
 
Core java pract_sem iii
Core java pract_sem iiiCore java pract_sem iii
Core java pract_sem iii
 
Martin Fowler's Refactoring Techniques Quick Reference
Martin Fowler's Refactoring Techniques Quick ReferenceMartin Fowler's Refactoring Techniques Quick Reference
Martin Fowler's Refactoring Techniques Quick Reference
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
Odessapy2013 - Graph databases and Python
Odessapy2013 - Graph databases and PythonOdessapy2013 - Graph databases and Python
Odessapy2013 - Graph databases and Python
 
Java8 stream
Java8 streamJava8 stream
Java8 stream
 
Hadoop
HadoopHadoop
Hadoop
 
DCN Practical
DCN PracticalDCN Practical
DCN Practical
 
JavaScript Event Loop
JavaScript Event LoopJavaScript Event Loop
JavaScript Event Loop
 
Scala @ TomTom
Scala @ TomTomScala @ TomTom
Scala @ TomTom
 
NLP on a Billion Documents: Scalable Machine Learning with Apache Spark
NLP on a Billion Documents: Scalable Machine Learning with Apache SparkNLP on a Billion Documents: Scalable Machine Learning with Apache Spark
NLP on a Billion Documents: Scalable Machine Learning with Apache Spark
 
Collection
CollectionCollection
Collection
 
Programming with Python and PostgreSQL
Programming with Python and PostgreSQLProgramming with Python and PostgreSQL
Programming with Python and PostgreSQL
 
Java programs
Java programsJava programs
Java programs
 
Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного пр...
Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного пр...Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного пр...
Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного пр...
 
java experiments and programs
java experiments and programsjava experiments and programs
java experiments and programs
 
If You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongIf You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are Wrong
 

Viewers also liked

Etón Soulra
Etón Soulra Etón Soulra
Etón Soulra
Etón Corporation
 
La carta de un ángel a sus seres
La carta de un ángel a sus seresLa carta de un ángel a sus seres
La carta de un ángel a sus seres
Rosi Hernandez
 
Memoràndum
MemoràndumMemoràndum
Memoràndum
257777
 
Sankt Peter LifePR.doc
Sankt Peter LifePR.docSankt Peter LifePR.doc
Sankt Peter LifePR.doc
unn | UNITED NEWS NETWORK GmbH
 
23-11-2011 El Gobernador Guillermo Padrés inauguró la pavimentación de calles...
23-11-2011 El Gobernador Guillermo Padrés inauguró la pavimentación de calles...23-11-2011 El Gobernador Guillermo Padrés inauguró la pavimentación de calles...
23-11-2011 El Gobernador Guillermo Padrés inauguró la pavimentación de calles...
Guillermo Padrés Elías
 
Fuga projeto
Fuga projetoFuga projeto
Fuga projeto
RAPPER PIRATA
 
Turbofan Motorlar
Turbofan Motorlar Turbofan Motorlar
Turbofan Motorlar
Erhan DİLAVER
 
La mujer en la sagrada escritura
La mujer en la sagrada escrituraLa mujer en la sagrada escritura
La mujer en la sagrada escritura
Angela Cabrera
 
Full Page Fax Print2
Full Page Fax Print2Full Page Fax Print2
Full Page Fax Print2zsonflower
 
Tidewater Consortium, 22 July 09
Tidewater Consortium, 22 July 09Tidewater Consortium, 22 July 09
Tidewater Consortium, 22 July 09
George Needham
 
Double page annotated
Double page annotatedDouble page annotated
Double page annotatedrichyyevans
 
Lithuanian Economy - No 1, January 4, 2012
Lithuanian Economy - No 1, January 4,  2012Lithuanian Economy - No 1, January 4,  2012
Lithuanian Economy - No 1, January 4, 2012
Swedbank
 
Talking points for the high level youth policy dialogue on sustainable develo...
Talking points for the high level youth policy dialogue on sustainable develo...Talking points for the high level youth policy dialogue on sustainable develo...
Talking points for the high level youth policy dialogue on sustainable develo...
Dr Lendy Spires
 
There Is No Agile
There Is No AgileThere Is No Agile
There Is No Agile
Nick McKenna
 
Hasil Kelompok I
Hasil Kelompok IHasil Kelompok I
Hasil Kelompok I
Goodreads Indonesia
 
What makes indicators successful? Lessons from practitioners
What makes indicators successful? Lessons from practitionersWhat makes indicators successful? Lessons from practitioners
What makes indicators successful? Lessons from practitioners
nefwellbeing
 
Normativa - JJFF RITSI 2014
Normativa - JJFF RITSI 2014Normativa - JJFF RITSI 2014
Normativa - JJFF RITSI 2014
asociacion_ritsi
 
Están atentos a la lectura de un cuento
Están atentos a la lectura de un cuentoEstán atentos a la lectura de un cuento
Están atentos a la lectura de un cuento
beatriz azucena iñiguez
 
Proverbs 1b seek wisdom from god
Proverbs 1b seek wisdom from godProverbs 1b seek wisdom from god
Proverbs 1b seek wisdom from god
Gospel Baptist Tabernacle
 

Viewers also liked (19)

Etón Soulra
Etón Soulra Etón Soulra
Etón Soulra
 
La carta de un ángel a sus seres
La carta de un ángel a sus seresLa carta de un ángel a sus seres
La carta de un ángel a sus seres
 
Memoràndum
MemoràndumMemoràndum
Memoràndum
 
Sankt Peter LifePR.doc
Sankt Peter LifePR.docSankt Peter LifePR.doc
Sankt Peter LifePR.doc
 
23-11-2011 El Gobernador Guillermo Padrés inauguró la pavimentación de calles...
23-11-2011 El Gobernador Guillermo Padrés inauguró la pavimentación de calles...23-11-2011 El Gobernador Guillermo Padrés inauguró la pavimentación de calles...
23-11-2011 El Gobernador Guillermo Padrés inauguró la pavimentación de calles...
 
Fuga projeto
Fuga projetoFuga projeto
Fuga projeto
 
Turbofan Motorlar
Turbofan Motorlar Turbofan Motorlar
Turbofan Motorlar
 
La mujer en la sagrada escritura
La mujer en la sagrada escrituraLa mujer en la sagrada escritura
La mujer en la sagrada escritura
 
Full Page Fax Print2
Full Page Fax Print2Full Page Fax Print2
Full Page Fax Print2
 
Tidewater Consortium, 22 July 09
Tidewater Consortium, 22 July 09Tidewater Consortium, 22 July 09
Tidewater Consortium, 22 July 09
 
Double page annotated
Double page annotatedDouble page annotated
Double page annotated
 
Lithuanian Economy - No 1, January 4, 2012
Lithuanian Economy - No 1, January 4,  2012Lithuanian Economy - No 1, January 4,  2012
Lithuanian Economy - No 1, January 4, 2012
 
Talking points for the high level youth policy dialogue on sustainable develo...
Talking points for the high level youth policy dialogue on sustainable develo...Talking points for the high level youth policy dialogue on sustainable develo...
Talking points for the high level youth policy dialogue on sustainable develo...
 
There Is No Agile
There Is No AgileThere Is No Agile
There Is No Agile
 
Hasil Kelompok I
Hasil Kelompok IHasil Kelompok I
Hasil Kelompok I
 
What makes indicators successful? Lessons from practitioners
What makes indicators successful? Lessons from practitionersWhat makes indicators successful? Lessons from practitioners
What makes indicators successful? Lessons from practitioners
 
Normativa - JJFF RITSI 2014
Normativa - JJFF RITSI 2014Normativa - JJFF RITSI 2014
Normativa - JJFF RITSI 2014
 
Están atentos a la lectura de un cuento
Están atentos a la lectura de un cuentoEstán atentos a la lectura de un cuento
Están atentos a la lectura de un cuento
 
Proverbs 1b seek wisdom from god
Proverbs 1b seek wisdom from godProverbs 1b seek wisdom from god
Proverbs 1b seek wisdom from god
 

Similar to Dotnet 18

Java and j2ee_lab-manual
Java and j2ee_lab-manualJava and j2ee_lab-manual
Java and j2ee_lab-manual
hanumanthu mothukuru
 
.net progrmming part1
.net progrmming part1.net progrmming part1
.net progrmming part1
Dr.M.Karthika parthasarathy
 
What's new in C# 6 - NetPonto Porto 20160116
What's new in C# 6  - NetPonto Porto 20160116What's new in C# 6  - NetPonto Porto 20160116
What's new in C# 6 - NetPonto Porto 20160116
Paulo Morgado
 
Java practical
Java practicalJava practical
Java practical
william otto
 
TechTalk - Dotnet
TechTalk - DotnetTechTalk - Dotnet
TechTalk - Dotnet
heinrich.wendel
 
Sam wd programs
Sam wd programsSam wd programs
Sam wd programs
Soumya Behera
 
Java file
Java fileJava file
Java file
simarsimmygrewal
 
Java file
Java fileJava file
Java file
simarsimmygrewal
 
39927902 c-labmanual
39927902 c-labmanual39927902 c-labmanual
39927902 c-labmanual
Srinivasa Babji Josyula
 
39927902 c-labmanual
39927902 c-labmanual39927902 c-labmanual
39927902 c-labmanual
Srinivasa Babji Josyula
 
Sharable_Java_Python.pdf
Sharable_Java_Python.pdfSharable_Java_Python.pdf
Sharable_Java_Python.pdf
ICADCMLTPC
 
.net progrmming part2
.net progrmming part2.net progrmming part2
.net progrmming part2
Dr.M.Karthika parthasarathy
 
C#.net
C#.netC#.net
C#.net
vnboghani
 
ASP.NET
ASP.NETASP.NET
ASP.NET
chirag patil
 
C# Is The Future
C# Is The FutureC# Is The Future
C# Is The Future
Filip Ekberg
 
Advanced Java - Practical File
Advanced Java - Practical FileAdvanced Java - Practical File
Advanced Java - Practical File
Fahad Shaikh
 
Chapter i(introduction to java)
Chapter i(introduction to java)Chapter i(introduction to java)
Chapter i(introduction to java)
Chhom Karath
 
Java practical
Java practicalJava practical
Java practical
shweta-sharma99
 
Hems
HemsHems
Basic java, java collection Framework and Date Time API
Basic java, java collection Framework and Date Time APIBasic java, java collection Framework and Date Time API
Basic java, java collection Framework and Date Time API
jagriti srivastava
 

Similar to Dotnet 18 (20)

Java and j2ee_lab-manual
Java and j2ee_lab-manualJava and j2ee_lab-manual
Java and j2ee_lab-manual
 
.net progrmming part1
.net progrmming part1.net progrmming part1
.net progrmming part1
 
What's new in C# 6 - NetPonto Porto 20160116
What's new in C# 6  - NetPonto Porto 20160116What's new in C# 6  - NetPonto Porto 20160116
What's new in C# 6 - NetPonto Porto 20160116
 
Java practical
Java practicalJava practical
Java practical
 
TechTalk - Dotnet
TechTalk - DotnetTechTalk - Dotnet
TechTalk - Dotnet
 
Sam wd programs
Sam wd programsSam wd programs
Sam wd programs
 
Java file
Java fileJava file
Java file
 
Java file
Java fileJava file
Java file
 
39927902 c-labmanual
39927902 c-labmanual39927902 c-labmanual
39927902 c-labmanual
 
39927902 c-labmanual
39927902 c-labmanual39927902 c-labmanual
39927902 c-labmanual
 
Sharable_Java_Python.pdf
Sharable_Java_Python.pdfSharable_Java_Python.pdf
Sharable_Java_Python.pdf
 
.net progrmming part2
.net progrmming part2.net progrmming part2
.net progrmming part2
 
C#.net
C#.netC#.net
C#.net
 
ASP.NET
ASP.NETASP.NET
ASP.NET
 
C# Is The Future
C# Is The FutureC# Is The Future
C# Is The Future
 
Advanced Java - Practical File
Advanced Java - Practical FileAdvanced Java - Practical File
Advanced Java - Practical File
 
Chapter i(introduction to java)
Chapter i(introduction to java)Chapter i(introduction to java)
Chapter i(introduction to java)
 
Java practical
Java practicalJava practical
Java practical
 
Hems
HemsHems
Hems
 
Basic java, java collection Framework and Date Time API
Basic java, java collection Framework and Date Time APIBasic java, java collection Framework and Date Time API
Basic java, java collection Framework and Date Time API
 

Recently uploaded

Accounting for Restricted Grants When and How To Record Properly
Accounting for Restricted Grants  When and How To Record ProperlyAccounting for Restricted Grants  When and How To Record Properly
Accounting for Restricted Grants When and How To Record Properly
TechSoup
 
Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17
Celine George
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
Prof. Dr. K. Adisesha
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
سمير بسيوني
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
Mohammad Al-Dhahabi
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
blueshagoo1
 
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptxCapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapitolTechU
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
nitinpv4ai
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
deepaannamalai16
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
danielkiash986
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
Steve Thomason
 
How to Setup Default Value for a Field in Odoo 17
How to Setup Default Value for a Field in Odoo 17How to Setup Default Value for a Field in Odoo 17
How to Setup Default Value for a Field in Odoo 17
Celine George
 
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptxA Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
OH TEIK BIN
 
FinalSD_MathematicsGrade7_Session2_Unida.pptx
FinalSD_MathematicsGrade7_Session2_Unida.pptxFinalSD_MathematicsGrade7_Session2_Unida.pptx
FinalSD_MathematicsGrade7_Session2_Unida.pptx
JennySularte1
 
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
ShwetaGawande8
 
Information and Communication Technology in Education
Information and Communication Technology in EducationInformation and Communication Technology in Education
Information and Communication Technology in Education
MJDuyan
 
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
EduSkills OECD
 
CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...
Nguyen Thanh Tu Collection
 
How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17
Celine George
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
deepaannamalai16
 

Recently uploaded (20)

Accounting for Restricted Grants When and How To Record Properly
Accounting for Restricted Grants  When and How To Record ProperlyAccounting for Restricted Grants  When and How To Record Properly
Accounting for Restricted Grants When and How To Record Properly
 
Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
 
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptxCapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
 
How to Setup Default Value for a Field in Odoo 17
How to Setup Default Value for a Field in Odoo 17How to Setup Default Value for a Field in Odoo 17
How to Setup Default Value for a Field in Odoo 17
 
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptxA Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
 
FinalSD_MathematicsGrade7_Session2_Unida.pptx
FinalSD_MathematicsGrade7_Session2_Unida.pptxFinalSD_MathematicsGrade7_Session2_Unida.pptx
FinalSD_MathematicsGrade7_Session2_Unida.pptx
 
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
 
Information and Communication Technology in Education
Information and Communication Technology in EducationInformation and Communication Technology in Education
Information and Communication Technology in Education
 
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
 
CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...
 
How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
 

Dotnet 18

  • 1. STAR ACADEMY OF TECHNOLOGY AND MANAGEMENT INDORE COMPUTER SCIENCE & ENGINEERING DOTNET TECNOLOGY(CS-406) LAB MANUAL Submitted By : Name : RANJIT KUMAR NAHAK Session : Jan 2014-Jun 2014 Dept. : CSE, SATM
  • 2. 1) W.A.P to perform basic arithmetic calculation. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace add { class Program { static void Main(string[] args) { int a, b; Console.WriteLine("Enter first nos."); a = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Enter second no."); b = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("add is :{0}", a + b); Console.WriteLine("sub is :{0}",a-b); Console.WriteLine("multiis :{0}",a*b); Console.WriteLine("devi is :{0}",a/b); Console.ReadLine(); } } }
  • 4. 2) W.A.P to interchange the value of 2 variables without using third variable. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace swap { class Program { static void Main(string[] args) int a = 6; int b = 7; Console.WriteLine("the numbers before swapping a={0} and b={1}",a,b); a = a + b; b = a - b; a = a - b; Console.WriteLine("the numbers after swapping a={0} and b={1}", a, b); Console.Read(); } } }
  • 6. 3) W.A.P to display array elements & their sum. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace array { class Program { static void Main(string[] args) { int[] num = { 10, 20, 30, 40 }; int n = num.Length; Console.WriteLine("array elements"); for (int i = 0; i < n; i++) { Console.WriteLine(num[i]); } int sum = 0; for (int i = 0; i < n; i++) { sum = sum + num[i]; } Console.WriteLine("sum"+sum); Console.Read(); } } }
  • 8. 4) W.A.P to input array elements & sort them. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace arrayip { class Program { static void Main(string[] args) int i, j, temp; int[] ar = new int[5]; Console.WriteLine("Enter the elements of array"); for (i = 0; i < ar.Length; i++) { ar[i] = Convert.ToInt32(Console.ReadLine()); } Console.WriteLine("Sorted array is: "); { for (i = 0; i < ar.Length; i++) { for (j = i + 1; j < ar.Length; j++) { if (ar[i] > ar[j]) { temp = ar[i]; ar[i] = ar[j]; ar[j] = temp; } } } for (i = 0; i < ar.Length; i++) { Console.Write(ar[i]); Console.ReadLine(); } } } }}
  • 10. 5) W.A.P using c lass. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace { class Program { class student { String nm, dep, gen; public void setdata() { Console.WriteLine("Eter Name"); nm = Console.ReadLine(); Console.WriteLine("Enter Dept"); dep = Console.ReadLine(); Console.WriteLine("Enter gender"); gen = Console.ReadLine(); } public void putdata() { Console.WriteLine("Name " +nm); Console.WriteLine("DEPT " +dep); Console.WriteLine("Gender " +gen); } } static void Main(string[] args) { student stu = new student(); stu.setdata(); stu.putdata(); Console.ReadLine(); } } }
  • 12. 6) W.A.P to print fibonacci series. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace fibonic_series { class Program { static void Main(string[] args) { int a, b, c,n; a=0; b=1; Console.WriteLine("Enter Limit: "); n = Convert.ToInt32(Console.ReadLi ne()); Console.WriteLine( a); Console.WriteLine( b); for(int i=3;i<=n;i++) { c = a + b; a = b; b = c; Console.Writ eLine(c); } Console.ReadLine(); } } }
  • 14. 7) W.A.P using function overloading. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace funover { class Program { class worker { public void salary(int a, int b) { int total, bonus; Console.Write("Enter first bonus: "); bonus = Convert.ToInt32(Console.ReadLine()); total = bonus + a + b; Console.WriteLine(); Console.WriteLine("Total salary is: "+total); Console.WriteLine(); } public void salary(int a) { int total, bonus; Console.Write("Enter second bonus: "); bonus = Convert.ToInt32(Console.ReadLine()); total = bonus + a; Console.WriteLine(); Console.WriteLine("Total salary is: "+total); } } static void Main(string[] args) { worker w = new worker(); w.salary(5000,6000); w.salary(10000); Console.ReadLine(); } }
  • 16. 8) W.A.P to show multilevel inheritance. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace multiinhrit { class Area { public int l, b; public void cal_area() { Console.WriteLine(); Console.WriteLine("The area is:(l*b) " + (l * b)); } } class volume : Area { public int h; public void cal_volume() { Console.WriteLine(); Console.WriteLine("The volume is: " + (l * b * h)); } } class density : volume { int m; public density(int ll, int bb, int hh, int mm) { l = ll; b = bb; h = hh; m = mm; } public void cal_density() { int d; d = m / (l * b * h); Console.WriteLine(); Console.WriteLine("The density is: " + d); }
  • 17. public void showdata() { Console.WriteLine("The length is: " + l); Console.WriteLine(); Console.WriteLine("The breadth is: " + b); Console.WriteLine(); Console.WriteLine("The height is: " + h); Console.WriteLine(); Console.WriteLine("The mass is: " + m); } } class Program { static void Main(string[] args) density dense = new density(12,10,5,4000); dense.showdata(); dense.cal_volume(); dense.cal_area(); dense.cal_ density(); Console.R ead(); } } }
  • 19. 9) W.A.P to print star pyramid. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace star { class Program { static void Main(string[] args) { int i,j; Console.WriteLine("pyramid of star:"); for (i = 0; i <= 5; i++) { for (j = 0; j < i; j++) { Console.Write("*"); } Console.WriteLine(); } Console.ReadLine(); } } }
  • 21. 10) W.a.P to print the factorial of a given no. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace fact { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { int n,i,fact=1; n = Convert.ToInt32(textBox1.Text); for (i = 1; i <= n; i++) { fact = fact * i; } textBox2.Text = Convert.ToString(fact); }
  • 23. 11) W.A.P to find the greatest of three nos. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace greatest { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { int a, b, c; a = Convert.ToInt32(textBox1.Text); b = Convert.ToInt32(textBox2.Text); c = Convert.ToInt32(textBox3.Text); if (a > b && a > c) { MessageBox.Show("A is Greatest"); } else { if (b > c) { MessageBox.Show("B is Gratest"); } else { MessageBox.Show("C is Greatest"); } } textBox1.Text
  • 26. 12) W.A.P to display calculator. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace calc { public partial class Form1 : Form { String str = "";//globally String str1 = ""; Double i, j, k,flag=0; public Form1() { InitializeComponent(); } private void button16_Click(object sender, EventArgs e) { textBox1.Text = " "; textBox2.Text = " "; str = ""; } private void button1_Click(object sender, EventArgs e) { textBox1.Text =str+ "1"; str = textBox1.Text; } private void button2_Click(object sender, EventArgs e) {
  • 27. textBox1.Text =str+ "2"; str = textBox1.Text; } private void button3_Click(object sender, EventArgs e) { textBox1.Text = str+"3"; str = textBox1.Text; } private void button4_Click(object sender, EventArgs e) { textBox1.Text = str+"4"; str = textBox1.Text; } private void button5_Click(object sender, EventArgs e) { textBox1.Text = str+"5"; str = textBox1.Text; } private void button6_Click(object sender, EventArgs e) { textBox1.Text = str+"6"; str = textBox1.Text; } private void button7_Click(object sender, EventArgs e) { textBox1.Text = str+"7"; str = textBox1.Text; } private void button8_Click(object sender, EventArgs e) { textBox1.Text = str+"8"; str = textBox1.Text; }
  • 28. private void button9_Click(object sender, EventArgs e) { textBox1.Text = str+"9"; str = textBox1.Text; } private void button10_Click(object sender, EventArgs e) { textBox1.Text = str+"0"; str = textBox1.Text; } private void Form1_Load(object sender, EventArgs e) { } private void button11_Click(object sender, EventArgs e) { textBox2.Text = textBox1.Text; textBox1.Text = ""; str = ""; str1 = "+"; } private void button15_Click(object sender, EventArgs e) { i = Convert.ToDouble(textBox2.Text); j = Convert.ToDouble(textBox1.Text); if (str1 == "+") k = i + j; if (str1 == "-") k = i - j; if (str1 == "*") k = i * j; if (str1 == "/") k = i / j; if (str1 == "%") k = i % j; textBox1.Text = k.ToString(); }
  • 29. private void button12_Click(object sender, EventArgs e) { textBox2.Text = textBox1.Text; textBox1.Text = ""; str = ""; str1 = "-"; } private void button13_Click(object sender, EventArgs e) textBox2.Text = textBox1.Text; str = ""; str1 = "*"; } private void button14_Click(object sender, EventArgs e) { textBox2.Text = textBox1.Text; textBox1.Text = ""; str = ""; str1 = "/"; } private void button20_Click(object sender, EventArgs e) { textBox2.Text = textBox1.Text; textBox1.Text = ""; str = ""; str1 = "%"; } private void button18_Click(object sender, EventArgs e) { this.Close(); } private void button17_Click(object sender, EventArgs e) { if (flag == 0) { textBox1.Text = str + ".";
  • 30. str = textBox1.Text; flag = 1; } else { str = textBox1.Text; } }
  • 31.
  • 32. 13) W.A.P. for Notepad. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace notepad public partial class Form1 : Form ) { public Form1() { InitializeComponent(); } private void openToolStripMenuItem_Click(object sender, EventArgs e) { //Shows the openFileDialog openFileDialog1.ShowDialog(); //Reads the text file System.IO.StreamReader OpenFile = new System.IO.StreamReader(openFileDialog1.FileName); //Displays the text file in the textBox txtMain.Text = OpenFile.ReadToEnd(); //Closes the proccess OpenFile.Close(); } private void saveToolStripMenuItem_Click(object sender, EventArgs e) { //Determines the text file to save to System.IO.StreamWriterSaveFile = new System.IO.StreamWriter(openFileDialog1.FileName);
  • 33. //Writes the text to the file SaveFile.WriteLine(txtMain.Text); //Closes the proccess SaveFile.Close(); } private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) { //Open the saveFileDialog saveFileDialog1.ShowDialog(); //Determines the text file to save to System.IO.StreamWriterSaveFile = new System.IO.StreamWriter(saveFileDialog1.FileName); //Writes the text to the file SaveFile.WriteLine(txtMain.Text); //Closes the process txtMain.Undo(); } private void redoToolStripMenuItem_Click(object sender, EventArgs e) { txtMain.Undo(); } private void newToolStripMenuItem_Click(object sender, EventArgs SaveFile.Close(); } private void printToolStripMenuItem_Click(object sender, EventArgs e) { //Declare prntDoc as a new PrintDocument printDialog1.ShowDialog(); System.Drawing.Printing.PrintDocument prntDoc = new System.Drawing.Printing.PrintDocument(); } private void printPreviewToolStripMenuItem_Click(object sender, EventArgs e) { printPreviewDialog1.ShowDialog();
  • 34. } private void exitToolStripMenuItem_Click(object sender, EventArgs e) { Application.Exit(); } private void undoToolStripMenuItem_Click(object sender, EventArgs e) { e) { txtMain.Clear(); } private void cutToolStripMenuItem_Click(object sender, EventArgs e) { } private void copyToolStripMenuItem_Click(object sender, EventArgs e) { txtMain.Copy(); } private void pasteToolStripMenuItem_Click(object sender, EventArgs e) { txtMain.Paste(); } private void selectAllToolStripMenuItem_Click(object sender, EventArgs e) { txtMain.SelectAll(); } } }