C#netBpart (1) (1)
C#netBpart (1) (1)
PART B
Program.cs File
using System;
using System.Windows.Forms;
using System. Drawing;
namespace ConsoleApplication16
class Program
Application.Run(new Form1());
Form1.cs File:
using System;
using System.Collections;
using System. Data;
using System.Windows.Forms;
namespace ConsoleApplication16
public Form1()
InitializeComponent();
OUTPUT:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace subroutine
class Program
int result =
Add(25,25);
DispIayResuIts(result);
Console.ReadLine();
Console.WriteLine(results);
50
OUTPUT:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace heightofcandidate
class Program3
Console.Write("Enter no of ");
int n = int.Parse(Console.ReadLine());
double[] height = new double[n];
string[] name = new string[n];
Console.WriteLine("Enter (0} Candidates Name and Height:", n);
for (int i = 0; i < height.Length; i++)
name[i] = Console.ReadLine();
height[i] = double.Parse(Console.ReadLine());
Console.Write(name[i] + "\t");
Console.WriteLine(height[i]);
cnt++,"
OUTPUT:
Erter no of Candidates: 18
Enter 10 Candidates Name and Height :
Asha
157. 5 usha 126
gi rish
196
aka sh 150
uday 195
smitha
186
fat ha 176
uma 187.7
surya
167
ki can
186
Shortlisted Candidates Height:
Name Height
Asha 157. 5
gi rish 196
uday 195
smitha 186
latha 170
uma 187.7
sunya 167
ki ran 180
Total no of candidates selected 8
namespace studentregister
class Program
regno[i] = Console.ReadLine();
Console.WriteLine("\nRegister Number\tCourse\tSem\tYear");
for (int i = 0; i < regno.Length; i++)
sem = "Fifth";
year +=
"2019";
sem = "Third";
year +=
"2020";
sem = "First";
year +=
"2021";
//Course Checking
if (course == "BA")
Console.ReadLine();
OUTPUT:
b) return a + b;
b) return a - b;
b) return a * b;
return a / b;
class Sample
Console.ReadLine();
OUTPUT:
Two Numbe s :
iEnten
)2
)NOTE :
0:Add 2:Mul 3 Dżv
1:Sub
Operation[8]
Operation[1]
:
Operation[2j
Operation[3
]
using System;
public class
Demo
case 1:
Console.WriteLine("The number of generations are: (0}\n",
GC.MaxGeneration);
break;
case 2:
Console.WriteLine("The generation number of Demo obj is:
{0}\n",GC.GetGeneration(obj));
break;
case 3:
Console.WriteLine("Number of bytes allocated: (0}\n",
GC.GetTotaIMemory(true));
break;
default:
System.Environment. Exit(0);
break;
OUTPUT: