Practical File Dot Net (Nishu)
Practical File Dot Net (Nishu)
using System;
namespace calcurectangular
{
class Program
{
static void Main(string[] args)
{
int a,p,l,w;
Console.WriteLine("Enter the length of regtangle");
l = int.Parse(Console.ReadLine());
Console.WriteLine("Enter the width of regtangle");
w = int.Parse(Console.ReadLine());
p = 2*(l+w);
a = w * l;
Console.WriteLine("Parameter of rectangle :"+p);
Console.WriteLine("Area of rectangle :" + a);
Console.ReadLine();
}
}
}
Output:-
Practical 12
namespace oddeven
{
class Program
{
static void Main(string[] args)
{
{
int[] no = new int[6] ;
Console.WriteLine("Enter any 6 Numbers");
for (int l = 0; l < 6; l++)
{
no[l] = int.Parse(Console.ReadLine());
}
int[] E= new int[10];
int[] O = new int[10];
int i, j = 0, k = 0;
for (i = 0; i < 6; i++ {
if (no[i] % 2 == 0)
{
E[j] = no[i];
j++;
}
else
{
O[k] = no[i];
k++;
}
}
Console.WriteLine("Even numbers...");
for (i = 0; i < j; i++)
{
Console.WriteLine(E[i]);
}
Console.WriteLine("Odd numbers...");
for (is
= 0; i < k; i++)
{
Console.WriteLine(O[i]);
}
Console.ReadLine();
Output:-
namespace twoclss
{
class Program
{
static void Main(string[] args)
{
Teacher d = new Teacher();
d.Teach();
Student s = new Student();
s.Learn();
s.Teach();
Console.ReadKey();
}
class Teacher
{
public void Teach()
{
Console.WriteLine("Teach");
}
}
class Student : Teacher
{
public void Learn()
{
Console.WriteLine("Learn");
}
}
}
}
Output:-