When would a structure variable get destroyed?
Which of the following are true about classes and struct?
Which of the following statements is correct about the C#.NET code snippet given below?
struct Book
{
private String name;
private int noofpages;
private Single price;
}
Book b = new Book();Which of the following will be the correct output for the program given below?
namespace IndiabixConsoleApplication
{
struct Sample
{
public int i;
}
class MyProgram
{
static void Main(string[] args)
{
Sample x = new Sample();
Sample y;
x.i = y = x;
y.i = Console.WriteLine(x.i + " " + y.i);
}
}
}Which of the following statements is correct about the C#.NET code snippet given below?
class Trial
{
int i;
Decimal d;
}
struct Sample
{
private int x;
private Single y;
private Trial z;
}
Sample ss = new Sample();The space required for structure variables is allocated on stack.
Which of the following will be the correct output for the C#.NET program given below?
namespace IndiabixConsoleApplication
{
struct Sample
{
public int i;
}
class MyProgram
{
static void Main(string[] args)
{
Sample x = new Sample();
x.i =
fun(ref x);
Console.Write(x.i + " ");
}
public static void fun(ref Sample y)
{
y.i = Console.Write(y.i + " ");
}
}
}Which of the following statements is correct?
Which of the following statements are correct about Structures used in C#.NET?
How many bytes will the structure variable samp occupy in memory if it is defined as shown below?
class Trial
{
int i;
Decimal d;
}
struct Sample
{
private int x;
private Single y;
private Trial z;
}
Sample samp = new Sample();Creating empty structures is allowed in C#.NET.
Which of the following statements are correct about the structure declaration given below?
struct Book
{
private String name;
protected int totalpages;
public Single price;
public void Showdata()
{
Console.WriteLine(name + " " + totalpages + " " + price);
}
Book()
{
name = " ";
totalpages = price = 0.0f;
}
}
Book b = new Book();
Which of the following will be the correct result of the statement b = a in the C#.NET code snippet given below?
struct Address
{
private int plotno;
private String city;
}
Address a = new Address();
Address b;
b = a;Which of the following will be the correct output for the C#.NET program given below?
namespace IndiabixConsoleApplication
{
struct Sample
{
public int i;
}
class MyProgram
{
static void Main()
{
Sample x = new Sample();
x.i =
fun(x);
Console.Write(x.i + " ");
}
static void fun(Sample y)
{
y.i =
Console.Write(y.i + " ");
}
}
}Which of the following statements are correct?
C#.NET structures are always value types.
Which of the following is the correct way of setting values into the structure variable e defined below?
struct Emp
{
public String name;
public int age;
public Single sal;
}
Emp e = new Emp();e.name = "Amol";
e.age = 25;
e.sal = 5500;With e
{
.name = "Amol";
.age = 25;
.sal = 5500;
}With emp e
{
.name = "Amol";
.age = 25;
.sal = 5500;
}e -> name = "Amol";
e -> age = 25;
e -> sal = 5500;name = "Amol";
age = 25;
sal = 5500;Which of the following is the correct way to define a variable of the type struct Emp declared below?
struct Emp
{
private String name;
private int age;
private Single sal;
}