0
Alien head

programming languages Online Quiz - 56

Description: programming languages Online Quiz - 56
Number of Questions: 20
Created by:
Tags: programming languages

How to supress the COPYRIGHT statement issued while compiling a particular .cs file through command line

  1. /noconfig

  2. /nologo

  3. /out

  4. None

  5. All the Above

Answer: 2

MSIL stands for –

  1. Managed Software Intermediate Language

  2. Managed Software InterUsable Language

  3. MicroSoft Intermediate Language

  4. Machine Source Intermediate Language

  5. None

Answer: 3

Which Class in C# helps to compile a .cs file into .dll file programmatically ?

  1. System.Globalization

  2. System.Diagnostics

  3. CsharpCodeProvider

  4. IcodeCompiler

  5. All the Above

Answer: 3

CTS is contained in –

  1. Common Language Specification

  2. Common Language Runtime

  3. Base Class Library

  4. None

  5. All the Above

Answer: 2

In Which of these types do we store the difference between two dates?

  1. String

  2. Type

  3. TimeSpan

  4. int

  5. None

Answer: 3

Which of these is a value Type?

  1. Arrays

  2. Strings

  3. Enums

  4. None

  5. All the Above

Answer: 3

Which of these is not a method of DateTime object?

  1. AddTick()

  2. GetMonth()

  3. GetHashCode()

  4. AddMilliSeconds()

  5. All the Above

Answer: 2

The following will result in which of the following, if the prize is currently "10 dollars" print 'You won $prize';

  1. You won $10.00

  2. You won 10 dollars

  3. You won $prize

  4. You won $10

Answer: 3

For a time in the month of March, the localtime function will return a month of:

  1. 2

  2. 3

  3. Mar

  4. March

Answer: 1

What type of variable is INPUT?

  1. A File Handle

  2. A List

  3. A Code variable

  4. A Tyleglob

Answer: 1

Code 1: Code: my @lines = grep /^hi/, @allLines; Code 2: Code: my @lines = (); foreach (@allLines) { push (@lines,$_) if (/^hi/); } What is the difference between the two snippets (Code 1 and Code 2) above?

  1. In code 1, the operation occurs in one command; code 2 iterates each element in the array for matches.

  2. In code 1, the elements of @lines are the indexes in @allLines, in which matches were found.

  3. In code 1, the elements of "@lines" begin with the index in "@allLines", in which the match was found.

  4. In code 1, "@lines" may not necessarily be in the same order; the original lines appear in "@allLines".

Answer: 3

Which of the following is a valid scalar variable name?

  1. $section_32B

  2. $baby-boy

  3. $401k

  4. $tic#tac#toe

Answer: 1

open (INPUT,"){ print $_; } How many times will the file get printed?

  1. once

  2. twice

  3. the program will go on into infinite loop

  4. None of the above

Answer: 1

Which of these is a valid regular expression meaning "contains any digit"?

  1. /[1-9]/

  2. /^\d+$/

  3. /^\d+/

  4. m-\d-

Answer: 4

Output of the following:s/(\w)/\u$1/g;

  1. Changes all lower case letters in the string stored in the variable $_ to upper case

  2. Changes the first letter in the string stored in the variable $_ to upper case

  3. Changes all letters in the string stored in the most recently used scalar variable to upper case

  4. adds \u in front of every letter or digit in the string in $_

Answer: 1

The function to a delete file is

  1. untie

  2. delete

  3. unlink

  4. rm

Answer: 3

Which of these is NOT a standard output command:

  1. printf

  2. print

  3. type

  4. write

Answer: 3

The following will result in which of the following, if the prize is currently "10 Euros" print 'You won $prize';

  1. You won $5.00

  2. You won 5 dollars

  3. You won $prize

  4. You won $5

Answer: 3

assertions can force which of the constraints ......

  1. pre conditions

  2. post conditions

  3. exceptions

  4. class invariants

Answer: 1,2,4

public class Sample{ public static void main(String[] args){ int i=5; if(i==5) throw new ArithmeticException("i is 5"); System.out.println(i); } } Does the code compiles fine?

  1. True

  2. False

Answer: 2
+ View questions