A Practical File OF: Submitted To: Submitted by
A Practical File OF: Submitted To: Submitted by
PRACTICAL FILE
OF
.NET
SUBMITTED TO : SUBMITTED BY :
MRS. VENU MAM POOJA
[ASSISTANT PROFESSOR] MCA-3rd SEM
UNIVERSITY ROLL NO. 23128410055
1. Write a Program of Basic C# console application
statement iterative statement.
using System;
namespace ControlFlowDemo
{
class Program
{
static void Main(string[] args)
{
for (int i = 0; i < 5; i++)
{
Console.WriteLine("Welcome to C#.NET");
}
using System;
class GFG {
// Main Method
public static void Main()
{
// Declare the Jagged Array of four elements:
int[][] jagged_arr = new int[4][];
Output :
Row(0): 1 2 3 4
Row(1): 11 34 67
Row(2): 89 23
Row(3): 0 45 78 53 99
3. Demonstration the use of static class, static data
members.
// C++ Program to demonstrate the use of
// static data members
#include <iostream>
using namespace std;
// class definition
class A {
public:
// static data member here
static int x;
A() { cout << "A's constructor called " << endl; }
};
return 0;
}
Output :
Accessing static data member: 2
4. Write a program to implement the prostatic
properties or private field in c #.
using System;
// Constructor
public Person(string name)
{
Name = name;
}
Output :
Name: John Doe
Name cannot be empty.
Name: John Doe
5. Write a program to implement structure in c # for
preventing the value of student employee with
constructor.
using System;
struct StudentEmployee
{
public readonly string Name;
public readonly int ID;
public readonly double Salary;
class Program
{
static void Main()
{
// Creating an instance of StudentEmployee
StudentEmployee employee = new
StudentEmployee("John Doe", 12345, 50000.0);