SlideShare ist ein Scribd-Unternehmen logo
1 von 31
Downloaden Sie, um offline zu lesen
1
IT-406
Submitted to:- Submitted by:-
Prof.Vivek Jain Name :- Bhuvnesh Dubey
ITE.Dept. Roll no.:- 0904IT111005
Branch :- Information Technology
Shri Ram College of Engineering and Management
Banmore Morena
Dot Net Lab file
2
Index
S.no. Experiment name Page no. Submission
date
Remark
1. What is dot net? And what are the
features.
03
2. What are the major components of
dot net framework?
04
3. What is c#? Compare with java and
c++?
07
4. What do you mean by pure object
oriented programing language? Is
c# pure object oriented programing
language?
09
5. WAP in c# to display a string on
console screen.
10
6. Write a program for simple
calculation in c#.
11
7. Write a program for finding greater
no. between three numbers.
12
8. Write a program for find total
number, percentage and grade of
student according to its marks.
13
9. Write a program to demonstrate
mathematical calculation in
console form.
14
10. Wap to check the given number is
even or odd.
16
11. Write a program for call by value
function in console form.
17
12. Write a program for call by
reference function in console form.
19
13. Wap to Find max and min no. in
given three numbers.
20
14. Wap to display day for entered any
no. between 1-7 through the
keyboard.
21
3
15. Write a program for simple
calculator in window forms.
23
16. Wap to demonstrate the login form
in the form of window application.
25
17. Wap to find percentage and grades
by giving marks.
27
18. Wap to input your details on
student form and display them.
29
4
//1. What is dot net? And what are the features.
Definition:-
“The .net framework is a development and execution environment that allows
different programming languages and libraries to work together seamlessly to
create windows-based applications that are easier to build, manage, deploy, and
integrate with other networked systems.”
The .net framework is the heart of Microsoft .net .the .net framework is a
software development platform of Microsoft .net .like any platform, it provide a
runtime ,define functionality in some libraries, and supports a set of
programming languages. The .net framework provides a necessary compile-time
and run-time foundation to build and run .net based applications.
Features of .net framework:-
 It is a platform neutral framework.
 It is a layer between the operating system and the programming language.
 It supports many programming languages, including VB.NET, C# etc.
 .NET provide a common set of libraries, which can be accessed from any
.NET based programming language. There will be separate set of classes
and libraries for each language.
 In future versions of windows, .NET will be freely distributed as part of
operating system and users will never have to install .NET separately.
5
//2. What are the major components of dot net framework?
.NET Framework provides enormous advantages to software developers in
comparison to the advantages provided by other platforms. Microsoft has united
various modern as well as existing technologies of software development in
.NET Framework. These technologies are used by developers to develop highly
efficient applications for modern as well as future business needs.
The following are the key components of .NET Framework:
* .NET Framework Class Library
* Common Language Runtime
* Dynamic Language Runtimes (DLR)
* Application Domains
* Runtime Host
* Common Type System
* Metadata and Self-Describing Components
* Cross-Language Interoperability
* .NET Framework Security
* Profiling
* Side-by-Side Execution.
.Net Framework is a platform that provides tools and technologies to develop
Windows, Web and Enterprise applications.
It mainly contains two components,
1. Common Language Runtime (CLR)
2. .Net Framework Class Library.
1. Common Language Runtime (CLR):-
.Net Framework provides runtime environment called Common Language
Runtime (CLR).It provides an environment to run all the .Net Programs. The
code which runs under the CLR is called as Managed Code. Programmers need
not to worry on managing the memory if the programs are running under the
CLR as it provides memory management and thread management.
Programmatically, when our program needs memory, CLR allocates the
memory for scope and de-allocates the memory if the scope is completed.
Language Compilers (e.g. C#, VB.Net, J#) will convert the Code/Program to
Microsoft Intermediate Language (MSIL) intern this will be converted to
Native Code by CLR.
There are currently over 15 language compilers being built by Microsoft and
other companies also producing the code that will execute under CLR.
6
2. .Net Framework Class Library (FCL):-
This is also called as Base Class Library and it is common for all types of
applications i.e. the way you access the Library Classes and Methods in
VB.NET will be the same in C#, and it is common for all other languages
in.NET.
The following are different types of applications that can make use of .net
Class library.
1. Windows Application.
2. Console Application
3. Web Application.
4. XML Web Services.
5. Windows Services.
In short, developers just need to import the BCL in their language code and use
its predefined methods and properties to implement common and complex
functions like reading and writing to file, graphic rendering, database
interaction, and XML document manipulation.
Below are the few more concepts that we need to know and understand as part
of this .Net framework.
3. Common Type System (CTS):-
It describes set of data types that can be used in different .Net languages in
common. (i.e), CTS ensures that objects written in different .Net languages can
interact with each other.
For Communicating between programs written in any .NET complaint
language, the types have to be compatible on the basic level.
The common type system supports two general categories of types:
Value types:
Value types directly contain their data, and instances of value types are either
allocated on the stack or allocated inline in a structure. Value types can be built-
in (implemented by the runtime), user-defined, or enumerations.
Reference types:
Reference types store a reference to the value's memory address, and are
Allocated on the heap. Reference types can be self-describing types, pointer
types, or interface types. The type of a reference type can be determined from
values of self-describing types. Self-describing types are further split into arrays
and class types. The class types are user-defined classes, boxed value types, and
delegates.
7
4. Common Language Specification (CLS):-
It is a sub set of CTS and it specifies a set of rules that needs to be adhered or
satisfied by all language compilers targeting CLR. It helps in cross language
inheritance and cross language debugging.
Common language specification Rules:
It describes the minimal and complete set of features to produce code that can
be hosted by CLR. It ensures that products of compilers will work properly in
.NET environment.
Sample Rules:-
 Representation of text strings.
 Internal representation of enumerations.
 Definition of static members and this is a subset of the CTS.which all
.NET languages are expected to support.
 Microsoft has defined CLS which are nothing but guidelines that
language to follow so that it can communicate withother .NET languages
in a seamless manner.
8
//3. What is c# ? compare with java and c++ ?
C# (pronounced see sharp) is a multi-paradigm programming language
encompassing strong typing, imperative, declarative, functional, procedural,
generic, object-oriented (class-based), and component-oriented programming
disciplines.
It was developed by Microsoft within its .NET initiative and later approved as a
standard by Ecma (ECMA-334) and ISO (ISO/IEC 23270:2006).
C# is one of the programming languages designed for the Common Language
Infrastructure. C# is intended to be a simple, modern, general-purpose, object-
oriented programming language. Its development team is led by Anders
Hejlsberg. The most recent version is C# 5.0, which was released on August 15,
2012.
Comparison between c++ and c#
s.no. C++ C#
A. C++ is designed for general object
oriented programming.
C# is a simple, modern, object
oriented, and type-safe
programming language derived
from C and C++.
B. C++ was designed to be a low-
level platform-neutral object-
oriented programming language.
C# was designed to be a
somewhat higher-level
component-oriented language.
C. These support multiple
inheritances and templates.
There are no multiple inheritances
and
there are no templates
D. C++ code usually compiles to
assembly language.
C# by contrast compiles to
Intermediate language (IL).
E. C++ is not designed to free the
developers from the task of doing
memory management.
C# is designed to free the
developers from the task of doing
memory management
F. C++ is provide a delete operator. There is no equivalent to C++
delete operator in C#.
9
Comparison java and c#:-
s.no. Java C#
A. Java not use namespaces . C#'s namespaces are more similar
to those in C++.
B. Java does not include delegates. C# includes delegates,
C. Java requires that a source file
name must match the only public
class inside it.
C# allows multiple public classes
in the same file.
D. Java does not include operator
overloading.
C# allows operator overloading
E. Java is proprietary, though largely
controlled through an open
community process.
C# is defined by ECMA and ISO
standards
10
// 4. What do you mean by pure object oriented programing language? Is
c# pure object oriented programing language?
Object-oriented programming (OOP) is an approach to software development in
which the structure of the software is based on objects interacting with each
other to accomplish a task. This interaction takes the form of messages passing
back and forth between the objects. In response to a message, an object can
perform an action or method.
A programming language is called a pure object-oriented programming
language. If it support the all features of OOPS.
The basic features of OOPS are:-
1. Data Abstraction
2. Data Encapsulation
3. Polymorphism
4. Inheritance.
5. Classes.
6. Objects.
7. Dynamic binding.
8. Message passing.
9. All pre-defined types are Objects.
10.All operations performed by sending messages to Objects.
C# is not a pure object-oriented programming language because it not support
number 9 and 10 properties of oops.
11
//5. Write a program for print a message on screen.
using System;
class text
{
static void Main(string[] args)
{
Console.WriteLine("hello friends.......n this is Bhuvnesh Dubey");
}
}
Output:-
12
//6. Write a program for simple calculation in c#.
using System;
class calc
{
static void Main(string[] args)
{
int a = 25, b = 25, c,d,e,f;
c = a + b;
d = a - b;
e = a * b;
f = a / b;
Console.WriteLine ("sum of "+a+" and "+b+" is "+c);
Console.WriteLine("subtraction of " + a + " and " + b + " is " + d);
Console.WriteLine("multiplication of " + a + " and " + b + " is " + e);
Console.WriteLine("division of " + a + " and " + b + " is " + f);
}
}
Output :-
13
//7. write a program for finding greater no. between three numbers.
using System;
class greater_no
{
static void Main(string[] args)
{
int a = 10, b = 25,c=50;
Console.WriteLine("number a=" + a);
Console.WriteLine("number b=" + b);
Console.WriteLine("number c=" + c);
if (a > b && a>c)
Console.WriteLine("greater no. is a=" + a);
else if (b > a && b > c)
Console.WriteLine("greater no. is b=" + b);
else
Console.WriteLine("greater no. is c=" + c);
}
}
Output :-
14
//8. Write a program for find total number, percentage and grade of
student according to its marks.
using System;
class grade
{
static void Main(string[] args)
{ int a=80,b=98,c=65,d=85,e=75;
float f, g;
Console.WriteLine("number in subject1 = " + a);
Console.WriteLine("number in subject2 = " + b);
Console.WriteLine("number in subject3 = " + c);
Console.WriteLine("number in subject4 = " + d);
Console.WriteLine("number in subject5 = " + e);
f=(a+b+c+d+e);
g=f/5;
Console.WriteLine("grand total = " + f);
Console.WriteLine("percentage = " + g+"%");
if (g >= 100.00 || g <00.00)
Console.WriteLine("invalid grade please re-enter");
if (g >= 60.00 && g <= 100.00)
Console.WriteLine("congratulation grade is A");
else if (g >= 45.00 && g < 59.99)
Console.WriteLine("congratulation grade is B");
else if (g >= 33.00 && g < 44.99)
Console.WriteLine("congratulation grade is C");
else if (g >= 00.00 && g < 32.99)
Console.WriteLine(" Sorry you are fail !!!!!n work hard in next time");
}
}
Output:-
15
//9. Write a program to demonstrate mathematical calculation in console
form.
using System;
class calc
{static void Main(string[] args)
{float a, b,c;
char d;
Console.WriteLine("enter the number a= ");
a = float.Parse(Console.ReadLine());
Console.WriteLine("enter the number b= ");
b = float.Parse(Console.ReadLine());
Console.WriteLine("which type calculation do you wantn
for addition of two numbers press An
for subtraction of two numbers press Sn
for multiplication of two numbers press Mn
for division of two numbers press Dn");
Console.WriteLine("enter your choice = ");
d = char.Parse(Console.ReadLine());
switch (d)
{case 'A':
case 'a':
c = a + b;
Console.WriteLine("Addition = " + c);
break;
case 'S':
case 's':
c = a - b;
Console.WriteLine("subtraction = " + c);
break;
case 'M':
case 'm':
c = a * b;
Console.WriteLine("Multiplication = " + c);
break;
case 'D':
case 'd':
c = a / b;
Console.WriteLine("division = " + c);
break;
default:
Console.WriteLine("invalid choice");
break;
}} }
16
Output:-
17
//10. Wap to check the given number is even or odd.
using System;
class Program
{
static void Main(string[] args)
{
Double a;
Console.WriteLine("Enter number a =");
a = Convert.ToDouble(Console.ReadLine());
if (a%2 ==0)
Console.WriteLine("Entered no. is even");
else Console.WriteLine("Entered no. is odd");
Console.ReadLine();
}
}
Output:-
18
//11. Write a program for call by value function in console form.
Code:-
using System;
class Program
{
static void Main(string[] args)
{
double a, b;
Console.WriteLine("Enter number a =");
a = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Enter number b =");
b= Convert.ToDouble(Console.ReadLine());
Console.WriteLine("sum of "+a+" and "+b+"is "+add(a, b));
Console.WriteLine("subtraction of " + a + " and " + b + "is " + sub(a, b));
Console.WriteLine("multiplication of " + a + " and " + b + "is " + mul(a, b));
Console.WriteLine("division of " + a + " and " + b + "is " + div(a, b));
Console.ReadLine();
}
static double add(double x, double y)
{
double z;
z = x + y;
return (z);
}
static double sub(double x, double y)
{
double z;
z = x - y;
return (z);
}
static double mul(double x, double y)
{
double z;
z = x * y;
return (z);
}
static double div(double x, double y)
{
double z;
z = x /y;
return (z);
}
}
19
Output:-
20
// 12. Write a program for call by reference function in console form.
using System;
class Program
{
static void Main(string[] args)
{
double x,y;
Console.WriteLine("Enter value of a= ");
x=Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Enter value of b= ");
y=Convert.ToDouble(Console.ReadLine());
Console.WriteLine("You entered the values are na= "+x+"nb="+y);
swap(ref x,ref y);
Console.ReadLine();
}
static double swap(ref double a, ref double b)
{
double c;
c = a;
a = b;
b = c;
Console.WriteLine("After swapingnvalue of a= " + a + "nvalue of b= " + b);
return (a);
}
}
Output:-
21
//13. Wap to Find max and min no. in given three numbers.
using System;
class Program
{static void Main(string[] args)
{ Double a, b, c;
Console.WriteLine("Enter number a =");
a = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Enter number b =");
b = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Enter number b =");
c= Convert.ToDouble(Console.ReadLine());
if (a>b&& a>c)
Console.WriteLine("Maximum no. is "+a);
else if (b >a && b>c)
Console.WriteLine("Maximum no. is " + b);
else Console.WriteLine("Maximum no. is "+c);
if (a<b && a<c)
Console.WriteLine("Minimum no. is " + a);
else if (b<a && b< c)
Console.WriteLine("Minimum no. is " + b);
else Console.WriteLine("Minimum no. is " + c);
Console.ReadLine();
} }
Output :-
22
//14. Wap to display day for entered any no. between 1-7 through the
keyboard.
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 week_day
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text == "1")
label3.Text = "Day is Sunday";
else if (textBox1.Text == "2")
label3.Text = "Day is Monday";
else if (textBox1.Text == "3")
label3.Text = "Day is Tuesday";
else if (textBox1.Text == "4")
label3.Text = "Day is Wednesday";
else if (textBox1.Text == "5")
label3.Text = "Day is Thursday";
else if (textBox1.Text == "6")
label3.Text = "Day is Friday";
else if (textBox1.Text == "7")
label3.Text = "Day is Saturday";
else
label3.Text = "Invalid Number please re-enter number";
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Text = "";
label3.Text = "";
}}}
23
Output:-
24
//15. Write a program for simple calculator in window forms.
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 WindowsFormsApplication1
{public partial class Form1 : Form
{public Form1()
{InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{float a, b, c;
a = float.Parse(textBox1.Text);
b = float.Parse(textBox2.Text);
c = a + b;
label3.Text=c.ToString();}
private void button2_Click(object sender, EventArgs e)
{float g, h, i;
g= float.Parse(textBox1.Text);
h = float.Parse(textBox2.Text);
i = g - h;
label4.Text = i.ToString();}
private void button3_Click(object sender, EventArgs e)
{float x, y, z;
x = float.Parse(textBox1.Text);
y = float.Parse(textBox2.Text);
z= x * y;
label5.Text =z.ToString();}
private void button4_Click(object sender, EventArgs e)
{
float d, j, f;
d= float.Parse(textBox1.Text);
j= float.Parse(textBox2.Text);
f = d/j;
label6.Text = f.ToString();
} }}
25
Output:-
Before data input
After data input
26
//16. Wap to demonstrate the login form in the form of window application.
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 log_in
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (textBox3.Text == "Bhuvnesh Dubey" & textBox2.Text ==
"ranu@455" & textBox1.Text == "ranu@455")
MessageBox.Show("log in successfull");
else if(textBox3.Text=="Bhuvnesh Dubey" &
textBox2.Text=="ranu@455" & textBox1.Text!="ranu@455")
MessageBox.Show("Invalid Password ");
else
MessageBox.Show("Invalid Username and Password ");
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Text = "";
textBox2.Text = "";
textBox3.Text = "";
}}}
27
Output:-
On correct input
On wrong input
28
//17. Wap to find percentage and grades by giving marks.
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 percent
{public partial class Form1 : Form
{public Form1()
{ InitializeComponent();}
private void button1_Click(object sender, EventArgs e)
{float a, b, c, d, f, g;
a = float.Parse(textBox1.Text);
b = float.Parse(textBox2.Text);
c = float.Parse(textBox3.Text);
d = float.Parse(textBox4.Text);
f = float.Parse(textBox5.Text);
g = a + b + c + d + f;
label6.Text = g.ToString();}
private void button2_Click(object sender, EventArgs e)
{float a, b, c, d, f, g, h;
a = float.Parse(textBox1.Text);
b = float.Parse(textBox2.Text);
c = float.Parse(textBox3.Text);
d = float.Parse(textBox4.Text);
f = float.Parse(textBox5.Text);
g = a + b + c + d + f;
h = g / 5;
label7.Text = h.ToString();
if (h >= 60 && h <= 100)
label8.Text = "Congratulation Grade is A";
else if (h >= 45 && h < 60)
label8.Text = "Congratulation Grade is B";
else if (h >= 33 && h < 45)
label8.Text = "Congratulation Grade is C";
else if (h > 0 && h < 33)
label8.Text = " Sorry.......n your Grade is F nyou are fail!!!!!";
else
label8.Text = "Invalid marksnplease Re-enter your Marks";}}}
29
Output:-
30
//18. Wap to input your details on student form and display them.
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 studentform
{public partial class Form1 : Form
{public Form1()
{InitializeComponent();}
private void button1_Click(object sender, EventArgs e)
{if (textBox1.Text != ""&& textBox2.Text != ""&&
textBox3.Text != ""&& textBox4.Text != ""&& textBox5.Text != ""
&& textBox6.Text != ""&& textBox7.Text != ""&& textBox8.Text != ""
&& textBox9.Text != ""&& textBox10.Text != "")
MessageBox.Show("Form submission successfullnHave a Good day");
Else
MessageBox.Show("form not submitted successfullynplease fill all information
carefully");}
private void button2_Click(object sender, EventArgs e)
{textBox1.Text = ""; textBox2.Text = "";
textBox3.Text = ""; textBox4.Text = "";
textBox5.Text = ""; textBox6.Text = "";
textBox7.Text = ""; textBox8.Text = "";
textBox9.Text = ""; textBox10.Text = "";}
private void button3_Click(object sender, EventArgs e)
{MessageBox.Show("Check Details before submissionn
Your Detail are:-n
Your Name: " + textBox1.Text + " " + textBox2.Text +
"n Date of Birth: " + textBox3.Text +
"n E-mail id: " + textBox4.Text +
"n Fathers Name: " + textBox5.Text +
"n Enrollment No.: " + textBox6.Text +
"n Branch: " + textBox7.Text +
"n College Name: " + textBox8.Text +
"n Address: " + textBox9.Text +
"n Contact No.: " + textBox10.Text);
}}}
31
Output:-
On click submit on click check details

Weitere ähnliche Inhalte

Was ist angesagt?

.Net framework
.Net framework.Net framework
.Net frameworkRaghu nath
 
Session2 (3)
Session2 (3)Session2 (3)
Session2 (3)DrUjwala1
 
Dot Net Fundamentals
Dot Net FundamentalsDot Net Fundamentals
Dot Net FundamentalsLiquidHub
 
C# programming language
C# programming languageC# programming language
C# programming languageswarnapatil
 
Architecture of net framework
Architecture of net frameworkArchitecture of net framework
Architecture of net frameworkumesh patil
 
Dot net-interview-questions-and-answers part i
Dot net-interview-questions-and-answers part iDot net-interview-questions-and-answers part i
Dot net-interview-questions-and-answers part iRakesh Joshi
 
Dot net-interview-questions-and-answers part i
Dot net-interview-questions-and-answers part iDot net-interview-questions-and-answers part i
Dot net-interview-questions-and-answers part iRakesh Joshi
 
Dotnet ch1
Dotnet ch1Dotnet ch1
Dotnet ch1007laksh
 
Object oriented-programming-in-c-sharp
Object oriented-programming-in-c-sharpObject oriented-programming-in-c-sharp
Object oriented-programming-in-c-sharpAbefo
 
Introduction to c_sharp
Introduction to c_sharpIntroduction to c_sharp
Introduction to c_sharpHEM Sothon
 
A Comparison of .NET Framework vs. Java Virtual Machine
A Comparison of .NET Framework vs. Java Virtual MachineA Comparison of .NET Framework vs. Java Virtual Machine
A Comparison of .NET Framework vs. Java Virtual MachineAbdelrahman Hosny
 
.Net platform an understanding
.Net platform an understanding.Net platform an understanding
.Net platform an understandingBinu Bhasuran
 
6.origins genesis of .net technology
6.origins genesis of .net technology6.origins genesis of .net technology
6.origins genesis of .net technologyPramod Rathore
 
Architecture of .net framework
Architecture of .net frameworkArchitecture of .net framework
Architecture of .net frameworkThen Murugeshwari
 
Net framework
Net frameworkNet framework
Net frameworkjhsri
 

Was ist angesagt? (20)

.Net framework
.Net framework.Net framework
.Net framework
 
Session2 (3)
Session2 (3)Session2 (3)
Session2 (3)
 
Dot Net Fundamentals
Dot Net FundamentalsDot Net Fundamentals
Dot Net Fundamentals
 
Inside.Net
Inside.NetInside.Net
Inside.Net
 
1.Philosophy of .NET
1.Philosophy of .NET1.Philosophy of .NET
1.Philosophy of .NET
 
C# programming language
C# programming languageC# programming language
C# programming language
 
Architecture of net framework
Architecture of net frameworkArchitecture of net framework
Architecture of net framework
 
Dot net-interview-questions-and-answers part i
Dot net-interview-questions-and-answers part iDot net-interview-questions-and-answers part i
Dot net-interview-questions-and-answers part i
 
Dot net-interview-questions-and-answers part i
Dot net-interview-questions-and-answers part iDot net-interview-questions-and-answers part i
Dot net-interview-questions-and-answers part i
 
Dotnet ch1
Dotnet ch1Dotnet ch1
Dotnet ch1
 
Object oriented-programming-in-c-sharp
Object oriented-programming-in-c-sharpObject oriented-programming-in-c-sharp
Object oriented-programming-in-c-sharp
 
C#.NET
C#.NETC#.NET
C#.NET
 
Introduction to c_sharp
Introduction to c_sharpIntroduction to c_sharp
Introduction to c_sharp
 
A Comparison of .NET Framework vs. Java Virtual Machine
A Comparison of .NET Framework vs. Java Virtual MachineA Comparison of .NET Framework vs. Java Virtual Machine
A Comparison of .NET Framework vs. Java Virtual Machine
 
.Net platform an understanding
.Net platform an understanding.Net platform an understanding
.Net platform an understanding
 
6.origins genesis of .net technology
6.origins genesis of .net technology6.origins genesis of .net technology
6.origins genesis of .net technology
 
Architecture of .net framework
Architecture of .net frameworkArchitecture of .net framework
Architecture of .net framework
 
Tutorial c#
Tutorial c#Tutorial c#
Tutorial c#
 
Net framework
Net frameworkNet framework
Net framework
 
Namespaces in C#
Namespaces in C#Namespaces in C#
Namespaces in C#
 

Andere mochten auch

Accurate and Efficient Secured Dynamic Multi-keyword Ranked Search
Accurate and Efficient Secured Dynamic Multi-keyword Ranked SearchAccurate and Efficient Secured Dynamic Multi-keyword Ranked Search
Accurate and Efficient Secured Dynamic Multi-keyword Ranked SearchDakshineshwar Swain
 
parque eolico punta colorada
parque eolico punta coloradaparque eolico punta colorada
parque eolico punta coloradapepetrueno2k
 
2014 ftth council ap the indigenous connectivity gap - gill
2014 ftth council ap   the indigenous connectivity gap - gill2014 ftth council ap   the indigenous connectivity gap - gill
2014 ftth council ap the indigenous connectivity gap - gilliwhglobal
 
Program setara d1 teknologi informasi dan komunikasi
Program setara d1 teknologi informasi dan komunikasiProgram setara d1 teknologi informasi dan komunikasi
Program setara d1 teknologi informasi dan komunikasiHedy Ramadhan
 
Vineet Malu-Resume
Vineet Malu-ResumeVineet Malu-Resume
Vineet Malu-ResumeVineet Malu
 
Situation Analysis - MyRelo FYP
Situation Analysis - MyRelo FYPSituation Analysis - MyRelo FYP
Situation Analysis - MyRelo FYPweiting1243
 
Www.icomold.com
Www.icomold.comWww.icomold.com
Www.icomold.comgarycrity
 
Penimbangan BB dan Pengukuran TB
Penimbangan BB dan Pengukuran TBPenimbangan BB dan Pengukuran TB
Penimbangan BB dan Pengukuran TBRyaniegizi
 
Penggunaan KMS
Penggunaan KMSPenggunaan KMS
Penggunaan KMSRyaniegizi
 

Andere mochten auch (15)

HBC
HBCHBC
HBC
 
Accurate and Efficient Secured Dynamic Multi-keyword Ranked Search
Accurate and Efficient Secured Dynamic Multi-keyword Ranked SearchAccurate and Efficient Secured Dynamic Multi-keyword Ranked Search
Accurate and Efficient Secured Dynamic Multi-keyword Ranked Search
 
parque eolico punta colorada
parque eolico punta coloradaparque eolico punta colorada
parque eolico punta colorada
 
Aerogeneradores
AerogeneradoresAerogeneradores
Aerogeneradores
 
2014 ftth council ap the indigenous connectivity gap - gill
2014 ftth council ap   the indigenous connectivity gap - gill2014 ftth council ap   the indigenous connectivity gap - gill
2014 ftth council ap the indigenous connectivity gap - gill
 
Program setara d1 teknologi informasi dan komunikasi
Program setara d1 teknologi informasi dan komunikasiProgram setara d1 teknologi informasi dan komunikasi
Program setara d1 teknologi informasi dan komunikasi
 
Vineet Malu-Resume
Vineet Malu-ResumeVineet Malu-Resume
Vineet Malu-Resume
 
Tutorial c 3
Tutorial c 3Tutorial c 3
Tutorial c 3
 
NoSQL Basics - A Quick Tour
NoSQL Basics - A Quick TourNoSQL Basics - A Quick Tour
NoSQL Basics - A Quick Tour
 
Situation Analysis - MyRelo FYP
Situation Analysis - MyRelo FYPSituation Analysis - MyRelo FYP
Situation Analysis - MyRelo FYP
 
Www.icomold.com
Www.icomold.comWww.icomold.com
Www.icomold.com
 
NoSQL Basics - a quick tour
NoSQL Basics - a quick tourNoSQL Basics - a quick tour
NoSQL Basics - a quick tour
 
Engineering education, the crux of the matter
Engineering education, the crux of the matterEngineering education, the crux of the matter
Engineering education, the crux of the matter
 
Penimbangan BB dan Pengukuran TB
Penimbangan BB dan Pengukuran TBPenimbangan BB dan Pengukuran TB
Penimbangan BB dan Pengukuran TB
 
Penggunaan KMS
Penggunaan KMSPenggunaan KMS
Penggunaan KMS
 

Ähnlich wie Dot net

Components of .NET Framework
Components of .NET FrameworkComponents of .NET Framework
Components of .NET FrameworkRoshith S Pai
 
Dotnet interview qa
Dotnet interview qaDotnet interview qa
Dotnet interview qaabcxyzqaz
 
.Net framework components by naveen kumar veligeti
.Net framework components by naveen kumar veligeti.Net framework components by naveen kumar veligeti
.Net framework components by naveen kumar veligetiNaveen Kumar Veligeti
 
Unit I- Introduction to .NET Framework.pdf
Unit I- Introduction to .NET Framework.pdfUnit I- Introduction to .NET Framework.pdf
Unit I- Introduction to .NET Framework.pdfUjwala Junghare
 
Introduction to .net
Introduction to .net Introduction to .net
Introduction to .net Jaya Kumari
 
Web technology slideshare
Web technology slideshareWeb technology slideshare
Web technology slideshareGuruAbirami2
 
programming in c#.ppt
programming in c#.pptprogramming in c#.ppt
programming in c#.pptNalinaKumari2
 
Chapter1_Part1.pptx
Chapter1_Part1.pptxChapter1_Part1.pptx
Chapter1_Part1.pptxRaajzKoirala
 
.Net overview|Introduction Of .net
.Net overview|Introduction Of .net.Net overview|Introduction Of .net
.Net overview|Introduction Of .netpinky singh
 
.Net framework
.Net framework.Net framework
.Net frameworkViv EK
 
New microsoft office word document
New microsoft office word documentNew microsoft office word document
New microsoft office word documentSIVAJISADHANA
 
New microsoft office word document
New microsoft office word documentNew microsoft office word document
New microsoft office word documentSIVAJISADHANA
 
New microsoft office word document
New microsoft office word documentNew microsoft office word document
New microsoft office word documentSIVAJISADHANA
 

Ähnlich wie Dot net (20)

Chapter1
Chapter1Chapter1
Chapter1
 
c#.pptx
c#.pptxc#.pptx
c#.pptx
 
Components of .NET Framework
Components of .NET FrameworkComponents of .NET Framework
Components of .NET Framework
 
Dotnet1
Dotnet1Dotnet1
Dotnet1
 
Dotnet interview qa
Dotnet interview qaDotnet interview qa
Dotnet interview qa
 
.Net framework components by naveen kumar veligeti
.Net framework components by naveen kumar veligeti.Net framework components by naveen kumar veligeti
.Net framework components by naveen kumar veligeti
 
Unit I- Introduction to .NET Framework.pdf
Unit I- Introduction to .NET Framework.pdfUnit I- Introduction to .NET Framework.pdf
Unit I- Introduction to .NET Framework.pdf
 
Introduction to .net
Introduction to .net Introduction to .net
Introduction to .net
 
Web technology slideshare
Web technology slideshareWeb technology slideshare
Web technology slideshare
 
C# chap 2
C# chap 2C# chap 2
C# chap 2
 
Microsoft.Net
Microsoft.NetMicrosoft.Net
Microsoft.Net
 
programming in c#.ppt
programming in c#.pptprogramming in c#.ppt
programming in c#.ppt
 
Chapter1_Part1.pptx
Chapter1_Part1.pptxChapter1_Part1.pptx
Chapter1_Part1.pptx
 
.Net overview|Introduction Of .net
.Net overview|Introduction Of .net.Net overview|Introduction Of .net
.Net overview|Introduction Of .net
 
.Net framework
.Net framework.Net framework
.Net framework
 
New microsoft office word document
New microsoft office word documentNew microsoft office word document
New microsoft office word document
 
New microsoft office word document
New microsoft office word documentNew microsoft office word document
New microsoft office word document
 
New microsoft office word document
New microsoft office word documentNew microsoft office word document
New microsoft office word document
 
Introduction to .net
Introduction to .netIntroduction to .net
Introduction to .net
 
Unit6
Unit6Unit6
Unit6
 

Kürzlich hochgeladen

A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projectssmsksolar
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfRagavanV2
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf203318pmpc
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...tanu pandey
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoordharasingh5698
 

Kürzlich hochgeladen (20)

A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 

Dot net

  • 1. 1 IT-406 Submitted to:- Submitted by:- Prof.Vivek Jain Name :- Bhuvnesh Dubey ITE.Dept. Roll no.:- 0904IT111005 Branch :- Information Technology Shri Ram College of Engineering and Management Banmore Morena Dot Net Lab file
  • 2. 2 Index S.no. Experiment name Page no. Submission date Remark 1. What is dot net? And what are the features. 03 2. What are the major components of dot net framework? 04 3. What is c#? Compare with java and c++? 07 4. What do you mean by pure object oriented programing language? Is c# pure object oriented programing language? 09 5. WAP in c# to display a string on console screen. 10 6. Write a program for simple calculation in c#. 11 7. Write a program for finding greater no. between three numbers. 12 8. Write a program for find total number, percentage and grade of student according to its marks. 13 9. Write a program to demonstrate mathematical calculation in console form. 14 10. Wap to check the given number is even or odd. 16 11. Write a program for call by value function in console form. 17 12. Write a program for call by reference function in console form. 19 13. Wap to Find max and min no. in given three numbers. 20 14. Wap to display day for entered any no. between 1-7 through the keyboard. 21
  • 3. 3 15. Write a program for simple calculator in window forms. 23 16. Wap to demonstrate the login form in the form of window application. 25 17. Wap to find percentage and grades by giving marks. 27 18. Wap to input your details on student form and display them. 29
  • 4. 4 //1. What is dot net? And what are the features. Definition:- “The .net framework is a development and execution environment that allows different programming languages and libraries to work together seamlessly to create windows-based applications that are easier to build, manage, deploy, and integrate with other networked systems.” The .net framework is the heart of Microsoft .net .the .net framework is a software development platform of Microsoft .net .like any platform, it provide a runtime ,define functionality in some libraries, and supports a set of programming languages. The .net framework provides a necessary compile-time and run-time foundation to build and run .net based applications. Features of .net framework:-  It is a platform neutral framework.  It is a layer between the operating system and the programming language.  It supports many programming languages, including VB.NET, C# etc.  .NET provide a common set of libraries, which can be accessed from any .NET based programming language. There will be separate set of classes and libraries for each language.  In future versions of windows, .NET will be freely distributed as part of operating system and users will never have to install .NET separately.
  • 5. 5 //2. What are the major components of dot net framework? .NET Framework provides enormous advantages to software developers in comparison to the advantages provided by other platforms. Microsoft has united various modern as well as existing technologies of software development in .NET Framework. These technologies are used by developers to develop highly efficient applications for modern as well as future business needs. The following are the key components of .NET Framework: * .NET Framework Class Library * Common Language Runtime * Dynamic Language Runtimes (DLR) * Application Domains * Runtime Host * Common Type System * Metadata and Self-Describing Components * Cross-Language Interoperability * .NET Framework Security * Profiling * Side-by-Side Execution. .Net Framework is a platform that provides tools and technologies to develop Windows, Web and Enterprise applications. It mainly contains two components, 1. Common Language Runtime (CLR) 2. .Net Framework Class Library. 1. Common Language Runtime (CLR):- .Net Framework provides runtime environment called Common Language Runtime (CLR).It provides an environment to run all the .Net Programs. The code which runs under the CLR is called as Managed Code. Programmers need not to worry on managing the memory if the programs are running under the CLR as it provides memory management and thread management. Programmatically, when our program needs memory, CLR allocates the memory for scope and de-allocates the memory if the scope is completed. Language Compilers (e.g. C#, VB.Net, J#) will convert the Code/Program to Microsoft Intermediate Language (MSIL) intern this will be converted to Native Code by CLR. There are currently over 15 language compilers being built by Microsoft and other companies also producing the code that will execute under CLR.
  • 6. 6 2. .Net Framework Class Library (FCL):- This is also called as Base Class Library and it is common for all types of applications i.e. the way you access the Library Classes and Methods in VB.NET will be the same in C#, and it is common for all other languages in.NET. The following are different types of applications that can make use of .net Class library. 1. Windows Application. 2. Console Application 3. Web Application. 4. XML Web Services. 5. Windows Services. In short, developers just need to import the BCL in their language code and use its predefined methods and properties to implement common and complex functions like reading and writing to file, graphic rendering, database interaction, and XML document manipulation. Below are the few more concepts that we need to know and understand as part of this .Net framework. 3. Common Type System (CTS):- It describes set of data types that can be used in different .Net languages in common. (i.e), CTS ensures that objects written in different .Net languages can interact with each other. For Communicating between programs written in any .NET complaint language, the types have to be compatible on the basic level. The common type system supports two general categories of types: Value types: Value types directly contain their data, and instances of value types are either allocated on the stack or allocated inline in a structure. Value types can be built- in (implemented by the runtime), user-defined, or enumerations. Reference types: Reference types store a reference to the value's memory address, and are Allocated on the heap. Reference types can be self-describing types, pointer types, or interface types. The type of a reference type can be determined from values of self-describing types. Self-describing types are further split into arrays and class types. The class types are user-defined classes, boxed value types, and delegates.
  • 7. 7 4. Common Language Specification (CLS):- It is a sub set of CTS and it specifies a set of rules that needs to be adhered or satisfied by all language compilers targeting CLR. It helps in cross language inheritance and cross language debugging. Common language specification Rules: It describes the minimal and complete set of features to produce code that can be hosted by CLR. It ensures that products of compilers will work properly in .NET environment. Sample Rules:-  Representation of text strings.  Internal representation of enumerations.  Definition of static members and this is a subset of the CTS.which all .NET languages are expected to support.  Microsoft has defined CLS which are nothing but guidelines that language to follow so that it can communicate withother .NET languages in a seamless manner.
  • 8. 8 //3. What is c# ? compare with java and c++ ? C# (pronounced see sharp) is a multi-paradigm programming language encompassing strong typing, imperative, declarative, functional, procedural, generic, object-oriented (class-based), and component-oriented programming disciplines. It was developed by Microsoft within its .NET initiative and later approved as a standard by Ecma (ECMA-334) and ISO (ISO/IEC 23270:2006). C# is one of the programming languages designed for the Common Language Infrastructure. C# is intended to be a simple, modern, general-purpose, object- oriented programming language. Its development team is led by Anders Hejlsberg. The most recent version is C# 5.0, which was released on August 15, 2012. Comparison between c++ and c# s.no. C++ C# A. C++ is designed for general object oriented programming. C# is a simple, modern, object oriented, and type-safe programming language derived from C and C++. B. C++ was designed to be a low- level platform-neutral object- oriented programming language. C# was designed to be a somewhat higher-level component-oriented language. C. These support multiple inheritances and templates. There are no multiple inheritances and there are no templates D. C++ code usually compiles to assembly language. C# by contrast compiles to Intermediate language (IL). E. C++ is not designed to free the developers from the task of doing memory management. C# is designed to free the developers from the task of doing memory management F. C++ is provide a delete operator. There is no equivalent to C++ delete operator in C#.
  • 9. 9 Comparison java and c#:- s.no. Java C# A. Java not use namespaces . C#'s namespaces are more similar to those in C++. B. Java does not include delegates. C# includes delegates, C. Java requires that a source file name must match the only public class inside it. C# allows multiple public classes in the same file. D. Java does not include operator overloading. C# allows operator overloading E. Java is proprietary, though largely controlled through an open community process. C# is defined by ECMA and ISO standards
  • 10. 10 // 4. What do you mean by pure object oriented programing language? Is c# pure object oriented programing language? Object-oriented programming (OOP) is an approach to software development in which the structure of the software is based on objects interacting with each other to accomplish a task. This interaction takes the form of messages passing back and forth between the objects. In response to a message, an object can perform an action or method. A programming language is called a pure object-oriented programming language. If it support the all features of OOPS. The basic features of OOPS are:- 1. Data Abstraction 2. Data Encapsulation 3. Polymorphism 4. Inheritance. 5. Classes. 6. Objects. 7. Dynamic binding. 8. Message passing. 9. All pre-defined types are Objects. 10.All operations performed by sending messages to Objects. C# is not a pure object-oriented programming language because it not support number 9 and 10 properties of oops.
  • 11. 11 //5. Write a program for print a message on screen. using System; class text { static void Main(string[] args) { Console.WriteLine("hello friends.......n this is Bhuvnesh Dubey"); } } Output:-
  • 12. 12 //6. Write a program for simple calculation in c#. using System; class calc { static void Main(string[] args) { int a = 25, b = 25, c,d,e,f; c = a + b; d = a - b; e = a * b; f = a / b; Console.WriteLine ("sum of "+a+" and "+b+" is "+c); Console.WriteLine("subtraction of " + a + " and " + b + " is " + d); Console.WriteLine("multiplication of " + a + " and " + b + " is " + e); Console.WriteLine("division of " + a + " and " + b + " is " + f); } } Output :-
  • 13. 13 //7. write a program for finding greater no. between three numbers. using System; class greater_no { static void Main(string[] args) { int a = 10, b = 25,c=50; Console.WriteLine("number a=" + a); Console.WriteLine("number b=" + b); Console.WriteLine("number c=" + c); if (a > b && a>c) Console.WriteLine("greater no. is a=" + a); else if (b > a && b > c) Console.WriteLine("greater no. is b=" + b); else Console.WriteLine("greater no. is c=" + c); } } Output :-
  • 14. 14 //8. Write a program for find total number, percentage and grade of student according to its marks. using System; class grade { static void Main(string[] args) { int a=80,b=98,c=65,d=85,e=75; float f, g; Console.WriteLine("number in subject1 = " + a); Console.WriteLine("number in subject2 = " + b); Console.WriteLine("number in subject3 = " + c); Console.WriteLine("number in subject4 = " + d); Console.WriteLine("number in subject5 = " + e); f=(a+b+c+d+e); g=f/5; Console.WriteLine("grand total = " + f); Console.WriteLine("percentage = " + g+"%"); if (g >= 100.00 || g <00.00) Console.WriteLine("invalid grade please re-enter"); if (g >= 60.00 && g <= 100.00) Console.WriteLine("congratulation grade is A"); else if (g >= 45.00 && g < 59.99) Console.WriteLine("congratulation grade is B"); else if (g >= 33.00 && g < 44.99) Console.WriteLine("congratulation grade is C"); else if (g >= 00.00 && g < 32.99) Console.WriteLine(" Sorry you are fail !!!!!n work hard in next time"); } } Output:-
  • 15. 15 //9. Write a program to demonstrate mathematical calculation in console form. using System; class calc {static void Main(string[] args) {float a, b,c; char d; Console.WriteLine("enter the number a= "); a = float.Parse(Console.ReadLine()); Console.WriteLine("enter the number b= "); b = float.Parse(Console.ReadLine()); Console.WriteLine("which type calculation do you wantn for addition of two numbers press An for subtraction of two numbers press Sn for multiplication of two numbers press Mn for division of two numbers press Dn"); Console.WriteLine("enter your choice = "); d = char.Parse(Console.ReadLine()); switch (d) {case 'A': case 'a': c = a + b; Console.WriteLine("Addition = " + c); break; case 'S': case 's': c = a - b; Console.WriteLine("subtraction = " + c); break; case 'M': case 'm': c = a * b; Console.WriteLine("Multiplication = " + c); break; case 'D': case 'd': c = a / b; Console.WriteLine("division = " + c); break; default: Console.WriteLine("invalid choice"); break; }} }
  • 17. 17 //10. Wap to check the given number is even or odd. using System; class Program { static void Main(string[] args) { Double a; Console.WriteLine("Enter number a ="); a = Convert.ToDouble(Console.ReadLine()); if (a%2 ==0) Console.WriteLine("Entered no. is even"); else Console.WriteLine("Entered no. is odd"); Console.ReadLine(); } } Output:-
  • 18. 18 //11. Write a program for call by value function in console form. Code:- using System; class Program { static void Main(string[] args) { double a, b; Console.WriteLine("Enter number a ="); a = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Enter number b ="); b= Convert.ToDouble(Console.ReadLine()); Console.WriteLine("sum of "+a+" and "+b+"is "+add(a, b)); Console.WriteLine("subtraction of " + a + " and " + b + "is " + sub(a, b)); Console.WriteLine("multiplication of " + a + " and " + b + "is " + mul(a, b)); Console.WriteLine("division of " + a + " and " + b + "is " + div(a, b)); Console.ReadLine(); } static double add(double x, double y) { double z; z = x + y; return (z); } static double sub(double x, double y) { double z; z = x - y; return (z); } static double mul(double x, double y) { double z; z = x * y; return (z); } static double div(double x, double y) { double z; z = x /y; return (z); } }
  • 20. 20 // 12. Write a program for call by reference function in console form. using System; class Program { static void Main(string[] args) { double x,y; Console.WriteLine("Enter value of a= "); x=Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Enter value of b= "); y=Convert.ToDouble(Console.ReadLine()); Console.WriteLine("You entered the values are na= "+x+"nb="+y); swap(ref x,ref y); Console.ReadLine(); } static double swap(ref double a, ref double b) { double c; c = a; a = b; b = c; Console.WriteLine("After swapingnvalue of a= " + a + "nvalue of b= " + b); return (a); } } Output:-
  • 21. 21 //13. Wap to Find max and min no. in given three numbers. using System; class Program {static void Main(string[] args) { Double a, b, c; Console.WriteLine("Enter number a ="); a = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Enter number b ="); b = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Enter number b ="); c= Convert.ToDouble(Console.ReadLine()); if (a>b&& a>c) Console.WriteLine("Maximum no. is "+a); else if (b >a && b>c) Console.WriteLine("Maximum no. is " + b); else Console.WriteLine("Maximum no. is "+c); if (a<b && a<c) Console.WriteLine("Minimum no. is " + a); else if (b<a && b< c) Console.WriteLine("Minimum no. is " + b); else Console.WriteLine("Minimum no. is " + c); Console.ReadLine(); } } Output :-
  • 22. 22 //14. Wap to display day for entered any no. between 1-7 through the keyboard. 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 week_day { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == "1") label3.Text = "Day is Sunday"; else if (textBox1.Text == "2") label3.Text = "Day is Monday"; else if (textBox1.Text == "3") label3.Text = "Day is Tuesday"; else if (textBox1.Text == "4") label3.Text = "Day is Wednesday"; else if (textBox1.Text == "5") label3.Text = "Day is Thursday"; else if (textBox1.Text == "6") label3.Text = "Day is Friday"; else if (textBox1.Text == "7") label3.Text = "Day is Saturday"; else label3.Text = "Invalid Number please re-enter number"; } private void button2_Click(object sender, EventArgs e) { textBox1.Text = ""; label3.Text = ""; }}}
  • 24. 24 //15. Write a program for simple calculator in window forms. 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 WindowsFormsApplication1 {public partial class Form1 : Form {public Form1() {InitializeComponent(); } private void button1_Click(object sender, EventArgs e) {float a, b, c; a = float.Parse(textBox1.Text); b = float.Parse(textBox2.Text); c = a + b; label3.Text=c.ToString();} private void button2_Click(object sender, EventArgs e) {float g, h, i; g= float.Parse(textBox1.Text); h = float.Parse(textBox2.Text); i = g - h; label4.Text = i.ToString();} private void button3_Click(object sender, EventArgs e) {float x, y, z; x = float.Parse(textBox1.Text); y = float.Parse(textBox2.Text); z= x * y; label5.Text =z.ToString();} private void button4_Click(object sender, EventArgs e) { float d, j, f; d= float.Parse(textBox1.Text); j= float.Parse(textBox2.Text); f = d/j; label6.Text = f.ToString(); } }}
  • 26. 26 //16. Wap to demonstrate the login form in the form of window application. 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 log_in { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { if (textBox3.Text == "Bhuvnesh Dubey" & textBox2.Text == "ranu@455" & textBox1.Text == "ranu@455") MessageBox.Show("log in successfull"); else if(textBox3.Text=="Bhuvnesh Dubey" & textBox2.Text=="ranu@455" & textBox1.Text!="ranu@455") MessageBox.Show("Invalid Password "); else MessageBox.Show("Invalid Username and Password "); } private void button2_Click(object sender, EventArgs e) { textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; }}}
  • 28. 28 //17. Wap to find percentage and grades by giving marks. 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 percent {public partial class Form1 : Form {public Form1() { InitializeComponent();} private void button1_Click(object sender, EventArgs e) {float a, b, c, d, f, g; a = float.Parse(textBox1.Text); b = float.Parse(textBox2.Text); c = float.Parse(textBox3.Text); d = float.Parse(textBox4.Text); f = float.Parse(textBox5.Text); g = a + b + c + d + f; label6.Text = g.ToString();} private void button2_Click(object sender, EventArgs e) {float a, b, c, d, f, g, h; a = float.Parse(textBox1.Text); b = float.Parse(textBox2.Text); c = float.Parse(textBox3.Text); d = float.Parse(textBox4.Text); f = float.Parse(textBox5.Text); g = a + b + c + d + f; h = g / 5; label7.Text = h.ToString(); if (h >= 60 && h <= 100) label8.Text = "Congratulation Grade is A"; else if (h >= 45 && h < 60) label8.Text = "Congratulation Grade is B"; else if (h >= 33 && h < 45) label8.Text = "Congratulation Grade is C"; else if (h > 0 && h < 33) label8.Text = " Sorry.......n your Grade is F nyou are fail!!!!!"; else label8.Text = "Invalid marksnplease Re-enter your Marks";}}}
  • 30. 30 //18. Wap to input your details on student form and display them. 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 studentform {public partial class Form1 : Form {public Form1() {InitializeComponent();} private void button1_Click(object sender, EventArgs e) {if (textBox1.Text != ""&& textBox2.Text != ""&& textBox3.Text != ""&& textBox4.Text != ""&& textBox5.Text != "" && textBox6.Text != ""&& textBox7.Text != ""&& textBox8.Text != "" && textBox9.Text != ""&& textBox10.Text != "") MessageBox.Show("Form submission successfullnHave a Good day"); Else MessageBox.Show("form not submitted successfullynplease fill all information carefully");} private void button2_Click(object sender, EventArgs e) {textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; textBox5.Text = ""; textBox6.Text = ""; textBox7.Text = ""; textBox8.Text = ""; textBox9.Text = ""; textBox10.Text = "";} private void button3_Click(object sender, EventArgs e) {MessageBox.Show("Check Details before submissionn Your Detail are:-n Your Name: " + textBox1.Text + " " + textBox2.Text + "n Date of Birth: " + textBox3.Text + "n E-mail id: " + textBox4.Text + "n Fathers Name: " + textBox5.Text + "n Enrollment No.: " + textBox6.Text + "n Branch: " + textBox7.Text + "n College Name: " + textBox8.Text + "n Address: " + textBox9.Text + "n Contact No.: " + textBox10.Text); }}}
  • 31. 31 Output:- On click submit on click check details