Qtr No. 213, New Town Yehlanka Indore 454775
What will be the output of the following code snippet?
public class Employee
{
int empID;
string name;
double basicSal;
public static int count;
static Employee()
{
count = 1000;
}
public Employee(string name,double basicSal)
{
empID = ++count;
this.name = name;
this.basicSal = basicSal+basicSal * .10;
}
public void Update(ref string lName, out double hra)
{
lName = this.name +" "+ lName;
}
}
public class Program
{
static void Main(string[] args)
{
Employee emp1 = new Employee("James",45000);
string lName = "Paul";
double hra = 4950;
emp1.Update(ref lName, out hra);
Console.WriteLine("Updated Data\nName={0}\nHRA={1}", lName,hra);
}
}
Select the output from the following options:
a. Updated Data
Name=James Paul
HRA=4950
b. Updated Data
Name=null
HRA=0
c. Updated Data
Name=James Paul
HRA=0
d. Compilation Error
Option a
Option b
Option c
Option d
To get all Basic CSharp Programming Assessment Exam questions Join Group https://bit.ly/infy_premium_group
We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.
Qtr No. 213, New Town Yehlanka Indore 454775
admin@prepflix.in