0

programming languages Online Quiz - 118

Description: programming languages Online Quiz - 118
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

What will the output of: Regex.Replace("01/02/03","([0-9]+)/([0-9]+)/([0-9]+)","$2/$1/$3");

  1. Exception

  2. 02/01/03

  3. 03/02/01

  4. 01/02/03


Correct Option: B

Which regular expression matches email address [email protected]?

  1. \w+@\w+.[\w]{3}

  2. ^(([A-Za-z0-9]+_+)|([A-Za-z0-9]+-+)|([A-Za-z0-9]+.+)|([A-Za-z0-9]+++))[A-Za-z0-9]+@((\w+-+)|(\w+.))\w{1,63}.[a-zA-Z]{2,6}

  3. [\w.-][a-zA-Z0-9_]@[\w.-][a-zA-Z0-9].[a-zA-Z][a-zA-Z.]*[a-zA-Z]

  4. All of above


Correct Option: D

Whch of the following is used as word boundary in Regular Expression?

  1. ^

  2. B

  3. b

  4. $


Correct Option: C

Where we can host WCF service?

  1. Windows service

  2. WAS

  3. None of above

  4. Both 1 and 2


Correct Option: D

WSHttpBinding uses SOAP 1.1.

  1. True

  2. False


Correct Option: B

What is the new activity available in .Net 3.5 for windows workflow which is used to expose workflow as service.

  1. Send Activity

  2. Web Service Input Activity

  3. Receive Activity

  4. None of These


Correct Option: C

What are the various contracts available in WCF.

  1. Service contract

  2. Operation contract

  3. Method contract

  4. Data Member Contract

  5. Message Contract

  6. Fault Contract


Correct Option: A,B,E,F

WCF have binding to support MSMQ.

  1. True

  2. False


Correct Option: A

What is the output ? main() { int i=8; printf("%d%d%d%d", i, i++, ++i, i); }

  1. 881010

  2. 89910

  3. 891010

  4. 10998


Correct Option: D

What is the output of the following C program? main() { int i=4,j=7; j = j || i++ && printf("YOU CAN"); printf("%d %d", i, j); }

  1. 5 7

  2. 4 7

  3. 5 1

  4. 4 1


Correct Option: D

What is the output of the following program ? main() { float a=1.1; double b=1.1; if (a==b) printf("Hai"); else printf("Hello"); }

  1. Compilation error-Type mismatch

  2. Hai

  3. Hello

  4. Run time error


Correct Option: C

What is the output of the following program ? main() { int a=10; { int a=100; { int a=1000; printf("%d", a); } printf("%d", a); } printf("%d", a); }

  1. 100010001000

  2. 100010010

  3. 101001000

  4. 010010001


Correct Option: B

What is the output ?main(){ int i; for(i=0;i<10;i++); printf("%d", i); }

  1. 10

  2. 11

  3. Compilation error-Null can not be there after for

  4. Infinite loop


Correct Option: A

main() { int i=20, *k; k=&i; printf("\n%d %d", i, k); ++*k; printf("\n%d %d", i, k); (*k)++; printf("\n%d %d", i, k); } Let the output of first print statement is 20 1000. What is the output of 2nd and third print statements ?

  1. 21 1000 21 1002

  2. 21 1000 Garbage_value 1002

  3. 21 1000 22 1002

  4. 21 1000 22 1000


Correct Option: D

What is the output ? main() { int x=2000, *p, y = 200; p = &y; x = x/*p; printf("%d", x); }

  1. 10

  2. Garbage value

  3. 100

  4. Compilation error


Correct Option: D

What is the output ?main(){ int a[5]={1,2,3,4,5}; a[7] = 23; printf("%d", a[7]);}

  1. 23

  2. Garbage Value

  3. 0

  4. Compilation-Array out of boundary


Correct Option: A

main(){ int i=5; char c; scanf ("%d", &c); printf("Here"); printf ("%d ", i);}For scanf in standard input the input is given as 63. then what will be displayed in the standard output ?

  1. 63 Here5

  2. 3 Here5

  3. 63 Here0

  4. 3 Here0


Correct Option: C
  1. public class Test { 2. public static void main(String args[]) { 3. class Foo { 4. public int i = 3; 5. } 6. Object o = (Object)new Foo(); 7. Foo foo = (Foo)o; 8. System.out.println(“i = “ + foo.i); 9. } 10. } What is the result?
  1. i = 3

  2. Compilation fails.

  3. A ClassCastException is thrown at line 6.

  4. A ClassCastException is thrown at line 7.


Correct Option: A

Which one cause a compiler error? (Choose two) a. float f2[] = new float[]; b. float[] f1 = new float[3]; c. float f3[] = new float[3]; d. float f4[] = new float[] { 1.0f, 2.0f, 3.0f};

  1. c

  2. a

  3. b

  4. d


Correct Option: B
  1. int i =1,j =10; 12. do { 13. if(i++> --j) { 14. continue; 15. } 16. } while (i <5); 17. System.out.println(“i = “ +i+ “and j = “+j); What is the result?
  1. i = 6 and j = 5

  2. i = 5 and j = 6

  3. i = 5 and j = 5

  4. i = 6 and j = 6


Correct Option: B
- Hide questions