0

programming languages Online Quiz - 141

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

1)main() { int i = 5; printf(“%d %d %d %d %d”,i++,i--,++i,--i,i); }

  1. 5 6 6 5 5

  2. 6 5 6 5 5

  3. 5 5 6 5 5

  4. 4 5 5 4 5


Correct Option: D

1)void main() { int const *p = 5; printf(“%d”,++(*p)); }

  1. 6

  2. junk value

  3. some address

  4. error


Correct Option: D

1)#define square(x) x*xmain(){ int i; i=64/square(4); printf(“%d”,i);}

  1. 32

  2. 4

  3. 64

  4. 16


Correct Option: C

1)main() { int a[2][3][2]={{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}}; printf(“%u %u %u %d”,a,a,a,a); printf(“%u %u %u %d\n”,a+1,*a+1,a+1,***a+1); } Provided base address of a is 100.

  1. 100 100 100 2 112 104 102 3

  2. 100 104 108 3 112 116 120 3

  3. 100 100 100 2 112 104 102 2

  4. 100 104 108 2 112 116 120 2


Correct Option: A

1)main() { static int a[]={0,1,2,3,4}; int p[]={a,a+1,a+2,a+3,a+4}; int **ptr=p; ptr++; printf(“\n%d%d%d”ptr-p,*ptr-a,ptr); *ptr++; printf(“\n%d%d%d”ptr-p,*ptr-a,ptr); *++ptr; printf(“\n%d%d%d”ptr-p,*ptr-a,ptr); ++*ptr; printf(“\n%d%d%d”ptr-p,*ptr-a,*ptr); }

  1. 123 234 340 012

  2. 111 222 333 444

  3. 111 222 444 333

  4. 012 340 234 123


Correct Option: B

Which of the following statements are valid array declaration?

  1. int number();

  2. float average[];

  3. double[] marks;

  4. counter int[];


Correct Option: B,C

Which of the following classes are available in the java.lang package?

  1. Object

  2. Math

  3. Random

  4. Stack


Correct Option: A,B

Which of the following are the wrapper classes?

  1. Byte

  2. Integer

  3. Short

  4. String


Correct Option: A,B,C

The methods wait() and notify() are defined in

  1. java.lang.Thread

  2. java.lang.Object

  3. java.lang.Runnable

  4. java.lang.ThreadGroup


Correct Option: B

An abstract class can have an object defined.

  1. True

  2. False


Correct Option: B

string s="tcs". This is a valid c++ syntax.

  1. True

  2. False


Correct Option: A

Static global variable in one c++ file can be used in another c++ file with the help of extern keyword.

  1. True

  2. False


Correct Option: B

“abc” is a primitive value

  1. True

  2. False


Correct Option: B

A class is a subclass of itself.

  1. True

  2. False


Correct Option: A

Exceptions can be rethrown.

  1. True

  2. False


Correct Option: A

void is the return type of a program’s main() method

  1. True

  2. False


Correct Option: A

non-Unicode letter characters $ and _ cannot be used as the first character of an identifier

  1. True

  2. False


Correct Option: B

this() is used to invoke a constructor of the same class

  1. True

  2. False


Correct Option: A
- Hide questions