C# Programming - Structures

Why should I learn to solve C# Programming questions and answers section on "Structures"?

Learn and practise solving C# Programming questions and answers section on "Structures" to enhance your skills so that you can clear interviews, competitive examinations, and various entrance tests (CAT, GATE, GRE, MAT, bank exams, railway exams, etc.) with full confidence.

Where can I get the C# Programming questions and answers section on "Structures"?

IndiaBIX provides you with numerous C# Programming questions and answers based on "Structures" along with fully solved examples and detailed explanations that will be easy to understand.

Where can I get the C# Programming section on "Structures" MCQ-type interview questions and answers (objective type, multiple choice)?

Here you can find multiple-choice C# Programming questions and answers based on "Structures" for your placement interviews and competitive exams. Objective-type and true-or-false-type questions are given too.

How do I download the C# Programming questions and answers section on "Structures" in PDF format?

You can download the C# Programming quiz questions and answers section on "Structures" as PDF files or eBooks.

How do I solve C# Programming quiz problems based on "Structures"?

You can easily solve C# Programming quiz problems based on "Structures" by practising the given exercises, including shortcuts and tricks.

Exercise : Structures - General Questions
  • Structures - General Questions
1.
The space required for structure variables is allocated on stack.
True
False
Answer: Option
Explanation:
No answer description is available. Let's discuss.

2.
Creating empty structures is allowed in C#.NET.
True
False
Answer: Option
Explanation:
No answer description is available. Let's discuss.

3.
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 = 10; 
            fun(x); 
            Console.Write(x.i + " ");
        }
        static void fun(Sample y)
        {
            y.i = 20; 
            Console.Write(y.i + " ");
        } 
    } 
}
10 20
10 10
20 10
20 20
None of the above
Answer: Option
Explanation:
No answer description is available. Let's discuss.

4.
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;
Answer: Option
Explanation:
No answer description is available. Let's discuss.

5.
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;
}
  1. Emp e(); e = new Emp();
  2. Emp e = new Emp;
  3. Emp e; e = new Emp;
  4. Emp e = new Emp();
  5. Emp e;
1, 3
2, 5
4, 5
1, 2, 4
Answer: Option
Explanation:
No answer description is available. Let's discuss.