.
  Vyom World.com . Let's Touch the Sky Together!  
.

Home
VyomWorld.com Home
Interview Questions
VyomLinks.com Home
JobsAssist.com Home
Vyom Network
Contact Us
Jobs & Careers
Resume Submitter
Placement Papers
IT Companies Directory
Computer Jobs
Interview Questions
Online Exams
Vyom Career eMag.
Fun
Send FREE SMS!
SMS Jokes
Source Codes Library
Source Codes Home
ASP Source Codes
C Source Codes
C++ Source Codes
COBOL Source Codes
Java Source Codes
Pascal Source Codes
Submit Source Codes
GATE
GATE an Overview
GATE Preparation
Study Materal
GRE
GRE an Overview
GRE Questions
GRE Preparation
GRE Universities
TOEFL Preparation
TOEFL Resources
GMAT Preparation
GMAT Resources
MBA Preparation
MBA Resources
Networking Concepts
Networking Concepts
Testing Preparation
Testing Resources
Webmasters
Free Traffic Builder
Webmaster Articles
Web Hosting
Tutorials
Hardware Tutorial
1500 Free eBooks New!


Home » Placement Papers » Mphasis Placement Papers » Mphasis Previous Year Placement Paper

 

Mphasis Placement Paper -: .Net Questions With Answers


Advertisements
Advertisements




Mphasis Previous Years Solved Sample Placement Papers

  1. To declare an array, define the variable type with ___.

    A: Square brackets []

    B: Curly brackets {}

    C: Round brackets ()

    D: None of the above

    Ans: A

    Explanation:

    To declare an array, define the variable type with square brackets [].

  2. What will be the output of the following C# code?

    using System;
    
    namespace MyApplication {
      class Program {
        static void Main(string[] args) {
          string[] mobiles = { "iPhone", "Samsung", "Vivo"};
          Console.WriteLine(mobiles);
        }
      }
    }
        

    A: "iPhone", "Samsung", "Vivo"

    B: {"iPhone", "Samsung", "Vivo"}

    C: string[]

    D: System.String[]

    Ans: D

    Explanation:

    In the above code, the statement Console.WriteLine(mobiles); will print the type of the variable that is System.String[].

  3. What will be the output of the following C# code?

    using System;
    
    namespace MyApplication {
      class Program {
        static void Main(string[] args) {
          string[] mobiles = {"iPhone", "Samsung", "Vivo"};
          Console.WriteLine(mobiles[-1]);
        }
      }
    }
        

    A: None

    B: Warning

    C: Exception

    D: System.String[]

    Ans: C

    Explanation:

    The array index starts from 0 in C#. In the above code, we are trying to access an element with index -1, resulting in an exception: System.IndexOutOfRangeException.

  4. Which statement is correct about the following C# statement?

    int[] x = {10, 20, 30};

    A: 'x' is a reference to the array created on stack

    B: 'x' is a reference to an object created on stack

    C: 'x' is a reference to an object of a 'System.Array' class

    D: None of the above

    Ans: C

    Explanation:

    In the above given C# statement, the variable x is a reference to an object of a System.Array class.

  5. Which array property is used to get the total number of elements in C#?

    A: Len

    B: Length

    C: Elements

    D: MaxLen

    Ans: B

    Explanation:

    The Length property is used to get the total number of elements in C#.

  6. What will be the output of the following C# code?

    using System;
    
    namespace MyApplication {
      class Program {
        static void Main(string[] args) {
          string[] mobiles = {"iPhone", "Samsung", "Vivo"};
          Console.WriteLine(mobiles[0] + mobiles[2]);
        }
      }
    }
        

    A: iPhoneVivo

    B: iPhone+Vivo

    C: Exception

    D: iPhone Vivo

    Ans: A

    Explanation:

    The statement mobiles[0] + mobiles[2] concatenates the 0th and 2nd elements, resulting in "iPhoneVivo".

  7. Which array method is used to sort an array alphabetically or in ascending order in C#?

    A: sort()

    B: sorting()

    C: Sort()

    D: Sorting()

    Ans: C

    Explanation:

    The Sort() method is used to sort an array alphabetically or in ascending order in C#.

  8. What will be the output of the following C# code?

    using System;
    
    namespace MyApplication {
      class Program {
        static void Main(string[] args) {
          int[,] ARR = {{1,2},{3,4}};
          Console.WriteLine(ARR.GetLength(0) + "," + ARR.GetLength(1));
        }
      }
    }
        

    A: 4,4

    B: 2,2

    C: Compilation Error

    D: Runtime Error

    Ans: B

    Explanation:

    The code prints the dimensions of the 2D array. The first dimension (rows) and the second dimension (columns) both have lengths of 2, so the output is 2,2.

  9. Which is the correct syntax to declare an array with 2 rows and 3 columns in C#?

    A: int arr[2][3] = new int[2][3];

    B: int arr[2,3] = new int[2,3];

    C: int[,] arr = new int[2,3];

    D: int [,]arr = new [2,3]int;

    Ans: C

    Explanation:

    The correct way to declare an array with 2 rows and 3 columns in C# is:

    int[,] arr = new int[2,3];




 


.

Recently Updated: New Placement Papers added.
Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Programming & Source Codes | GRE Preparation | Jobs, Discussions | Software Listing | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | International Business Information | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | FAQs | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Excellent Mobiles | Software Testing | Interview Questions | Freshers Jobs | Server Insiders | File Extension Directory

Copyright ©2003-2024 Vyom Technosoft Pvt. Ltd., All Rights Reserved. Read our Privacy Policy