0

programming languages Online Quiz - 69

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

In the following declaration of main, "int main(int argc, char *argv[])", to what does argv[0] usually correspond?

  1. The first argument passed into the program

  2. You can't define main like that

  3. The program name

  4. Null value


Correct Option: C

What is the last index number in an array of 100 chars?

  1. 99

  2. 100

  3. 101

  4. 100.0


Correct Option: A

What header file is needed for the function exit()?

  1. conio.h

  2. dos.h

  3. stdio.h

  4. stdlib.h


Correct Option: D

SELECT ABS(-15) "Absolute" FROM DUAL;

  1. -15

  2. 15

  3. 16

  4. 14


Correct Option: B

SELECT CEIL(15.7) "Ceiling" FROM DUAL;

  1. 16

  2. 15

  3. 14

  4. -15


Correct Option: A

SELECT FLOOR(15.7) "Floor" FROM DUAL;

  1. 16

  2. -15

  3. 14

  4. 15


Correct Option: D

SELECT REPLACE('JACK and JUE','J','BL')FROM DUAL;

  1. jack and jue

  2. JACK and JUE

  3. ACK and UE

  4. BLACK and BLUE


Correct Option: D

AI Explanation

To answer this question, let's go through each option and the result of the REPLACE function:

Option A) jack and jue - This option is incorrect because the REPLACE function replaces all occurrences of 'J' with 'BL', resulting in "BLACK and BLUE".

Option B) JACK and JUE - This option is incorrect because the REPLACE function replaces all occurrences of 'J' with 'BL', resulting in "BLACK and BLUE".

Option C) ACK and UE - This option is incorrect because the REPLACE function replaces all occurrences of 'J' with 'BL', resulting in "BLACK and BLUE".

Option D) BLACK and BLUE - This option is correct because the REPLACE function replaces all occurrences of 'J' with 'BL', resulting in "BLACK and BLUE".

The correct answer is option D.

SELECT MONTHS_BETWEEN TO_DATE('02-01-1995','MM-DD-YYYY'),TO_DATE('01-01-1995','MM-DD-YYYY') ) FROM DUAL;

  1. -1

  2. 0

  3. 1

  4. 2


Correct Option: C

SELECT POWER(3,2) FROM DUAL;

  1. 8

  2. 9

  3. 6

  4. -6


Correct Option: B

SELECT TO_CHAR( ADD_MONTHS(to_date('07-JUN-1994,'DD-MON-YYYY'),1), 'DD-MON-YYYY') FROM employees WHERE last_name = 'Baer';

  1. 06-JUN-1994

  2. 07-JUL-1994

  3. 06-JUL-1994

  4. 06-JUN-1995


Correct Option: B

SELECT SIN(30 * 3.14159265359/180) FROM DUAL;

  1. 1

  2. 0.866

  3. 0.5

  4. 0


Correct Option: C

SELECT MOD(11,4)FROM DUAL;

  1. 3

  2. 4

  3. 1

  4. 2


Correct Option: A

SELECT SQRT(25) FROM DUAL;

  1. 5

  2. 25

  3. 50

  4. 0


Correct Option: A

SELECT LENGTHB ('CANDIDE') FROM DUAL;

  1. 14

  2. 10

  3. 4

  4. 7


Correct Option: A

int i=3, j=4; if( i==3 || j++ ) { printf("%d\n",j); } This will print: 5

  1. True

  2. False


Correct Option: A

It is possible to call a macro recursively.

  1. True

  2. False


Correct Option: B

We can portably use the fflush(stdin); statement to clear the remaining characters in input stream.

  1. True

  2. False


Correct Option: B

conio.h is an ANSI standard header file.

  1. True

  2. False


Correct Option: B

conio.h is an ANSI standard header file.

  1. True

  2. False


Correct Option: B

In declaration of function parameters, int a[5] is equivalent to int *a.

  1. True

  2. False


Correct Option: A
- Hide questions