.
  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 » Motorola Placement Papers » Motorola Previous Year Placement Paper

 

Motorola Placement Paper -: .Net Questions With Answers


Advertisements
Advertisements




Motorola Previous Years Solved Sample Placement Papers

  1. What is the difference between Console.Write() and Console.WriteLine() methods in C#?

    A: Write() writes a single character while Console.WriteLine() writes a complete line

    B: Write() writes the data on the console without printing a newline while Console.WriteLine() writes the data on the console along with printing a newline

    C: Write() writes the string on the console while Console.WriteLine() writes the string as well as values of the variables on the console

    D: Both can be used for the same purpose

    Ans: B

    Explanation:

    The only difference between the Console.Write() and Console.WriteLine() is that the Console.Write() is used to write data without printing the new line, while Console.WriteLine() is used to write data along with printing the new line.

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

    using System;
    
    namespace MyApplication {
      class Program {
        static void Main(string[] args) {
          int a = 10, b = 20;
          Console.WriteLine("{0},{0}", a, b);
        }
      }
    }
        

    A: 10,10

    B: 10,20

    C: 20,20

    D: Error

    Ans: A

    Explanation:

    In the above code, there are two variables a and b, but while printing the values of a and b, we are using the same placeholder {0}, that will print the value of the first variable. Thus, the output is 10,10.

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

    using System;
    
    namespace MyApplication {
      class Program {
        static void Main(string[] args) {
          int a = 10, b = 20;
          Console.WriteLine("{0}+{1}", a, b);
        }
      }
    }
        

    A: 20

    B: 30

    C: 10+20

    D: 10+10

    Ans: C

    Explanation:

    In the statement, Console.WriteLine("{0}+{1}", a, b); - {0} is the placeholder for variable a and {1} is the placeholder for variable b. {0}+{1} will not perform any operation; values of a and b will be printed at the place of {0} and {1}. Thus, the output will be 10+20.

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

    using System;
    
    class Program {
      static void Main(string[] args) {
        int i = 2;
        int j = 10 / 4;
    
        if (i == j) {
          Console.WriteLine("True");
        } else {
          Console.WriteLine("False");
        }
      }
    }
        

    A: True

    B: False

    C: Error

    D: None

    Ans: A

    Explanation:

    The statement int j = 10 / 4; results in j being assigned the value 2 due to implicit type casting. Thus, the output will be "True".

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

    using System;
    
    class Program {
      static void Main(string[] args) {
        Console.WriteLine(true ^ true);
      }
    }
        

    A: True

    B: False

    C: Error

    D: None

    Ans: B

    Explanation:

    Here, we are using the Logical exclusive OR operator ^ (XOR). It returns true when one operand evaluates to true and the other evaluates to false. In the above code, both operands are true. Thus, the output will be False.

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

    using System;
    
    class Program {
      static void Main(string[] args) {
        Console.WriteLine(true && false);
      }
    }
        

    A: True

    B: False

    C: Error

    D: None

    Ans: B

    Explanation:

    Here, we are using the Conditional logical AND operator &&. It returns true only if both operands evaluate to true. In the above code, the operands are true and false. Thus, the output will be "False".




 


.

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