0

programming languages Online Quiz - 45

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

What types of flat files are acceptable to import into BW? i) ASCII ii) CSV iii)binary files iv)xml

  1. i & ii

  2. all of the above

  3. i,ii,iii

  4. ii


Correct Option: C

You can create variables for the following? i) characteristics ii) formulas iii) hierarchies iv) texts

  1. All of the options

  2. ii,iii

  3. i,iv

  4. i,ii,iii


Correct Option: A

Which message appears when you select “Use Query Drill” while scope of analysis is set in a BO BebI XI 3.X report?

  1. The scope of analysis is not empty

  2. The query drill mode option is enabled.

  3. The query drill mode option is not enabled.

  4. The scope of analysis is empty


Correct Option: A

AI Explanation

To answer this question, we need to understand the concept of "Query Drill" and the scope of analysis in BO BebI XI 3.X reports.

In BO BebI XI 3.X reports, the scope of analysis refers to the set of data that is being analyzed or considered in a report. The "Use Query Drill" option allows users to drill down into the data to get more detailed information.

Now let's go through each option to understand why it is correct or incorrect:

Option A) The scope of analysis is not empty - This option is correct because when you select "Use Query Drill" while the scope of analysis is set, it means that there is data available for drilling down. Therefore, this message will appear to indicate that the scope of analysis is not empty.

Option B) The query drill mode option is enabled - This option is incorrect because the message does not specifically mention that the query drill mode option is enabled. It only states that the scope of analysis is not empty.

Option C) The query drill mode option is not enabled - This option is incorrect because the message does not specifically state that the query drill mode option is not enabled. It only mentions the status of the scope of analysis.

Option D) The scope of analysis is empty - This option is incorrect because if the scope of analysis is empty, it means that there is no data available for analysis, and therefore, the "Use Query Drill" option would not be applicable. The message would not mention the scope of analysis being empty in this case.

The correct answer is option A. This option is correct because it accurately describes the message that appears when you select "Use Query Drill" while the scope of analysis is set in a BO BebI XI 3.X report.

Which wildcards can you use in a query filter? i)? ii)% iii)- iv)*

  1. i

  2. ii

  3. iii

  4. a & c


Correct Option: D

For which tasks do you use an If() function? i)To conditionally show rows in a block ii)To conditionally execute a scheduled report iii)To display dynamically grouped values iv)To display a dynamic list of values

  1. i

  2. iii

  3. a & b

  4. a & c

  5. a,b,c


Correct Option: D

Is Session Method, Asynchronous or Synchronous?

  1. Asynchronous

  2. Synchronous

  3. Synchronous and Asynchronous

  4. None of above


Correct Option: B

AI Explanation

To answer this question, we need to understand the concepts of synchronous and asynchronous methods.

Synchronous methods are those where the execution of code happens in a sequential manner. In other words, the code blocks are executed one after the other, and the program waits for each code block to finish before moving on to the next one.

On the other hand, asynchronous methods allow code execution to continue without waiting for a particular task to complete. Instead, a callback function or promise is used to handle the result of the asynchronous task when it completes.

In the case of the "Session" method, it is typically used to establish a connection between a client and a server. In most programming languages, the "Session" method is a synchronous method. This means that the program will wait for the session to be established before proceeding to the next line of code.

Therefore, the correct answer is:

B. Synchronous

Determine Output: main(){ unsigned int y = 12; int x = -2; if(x>y) printf(" x is greater"); else printf (" y is greater"); return 0;}

  1. x is greater

  2. y is greater

  3. compile error

  4. none


Correct Option: A

AI Explanation

To determine the output of the given code, let's analyze it step by step:

  1. The variable y is assigned the value 12, which is an unsigned integer.
  2. The variable x is assigned the value -2, which is a signed integer.
  3. The if statement checks if x is greater than y.
    • In this case, -2 is not greater than 12, so the condition evaluates to false.
  4. Since the condition is false, the code executes the else block.
  5. The printf statement inside the else block prints "y is greater" because the value of y is greater than x.
  6. Finally, the code returns 0.

Therefore, the output of the code will be:

Output: y is greater

So, the correct answer is option B: y is greater.

Determine output : main(){ int i=012; int j=046; int k=056; printf("i=%d",i); printf("j=%d",j); printf("k=%d",k);}

  1. 012046056

  2. 124656

  3. 103846

  4. 010038046


Correct Option: C

AI Explanation

To determine the output of the given code, let's go through each line:

int i=012;

In C, a number starting with a leading 0 is considered an octal (base 8) number. Therefore, 012 is interpreted as the octal value 12, which is equivalent to the decimal value 10.

int j=046;

Similarly, 046 is an octal number. In this case, it is equivalent to the decimal value 38.

int k=056;

Once again, 056 is an octal number, which is equal to the decimal value 46.

printf("i=%d",i);

This line uses the printf function to print the value of i as a decimal number. Since i is 10, the output will be "i=10".

printf("j=%d",j);

Similarly, this line prints the value of j as a decimal number. Since j is 38, the output will be "j=38".

printf("k=%d",k);

Again, this line prints the value of k as a decimal number. Since k is 46, the output will be "k=46".

Therefore, the correct answer is C) 103846.

Determine output: void main(){ int x,y; x = 5; y = ++x * ++x; printf("Value of x = %d and Value of y = %d\n",x,y);}

  1. 7,49

  2. 7,42

  3. 7,36

  4. 7,25


Correct Option: A

Determine Output: int counter (int value) { static int count =0; count = count +value; return count; } main() { int i , j; for (i=0; i <=5; i++) j = counter(i); printf("J = %d", j); return 0; }

  1. 5

  2. 4

  3. 10

  4. 15


Correct Option: D

AI Explanation

To determine the output of the given code, let's go through it step by step:

  1. We have a function named counter that takes an integer value as input. Inside the function, there is a static variable named count that is initialized to 0. The function adds the input value to the count variable and returns the updated value of count.

  2. In the main function, we have two integer variables i and j declared.

  3. There is a for loop that iterates from i = 0 to i &lt;= 5. In each iteration, the counter function is called with the current value of i, and the returned value is assigned to j.

  4. After the for loop, the value of j is printed using printf.

Let's track the value of j in each iteration of the for loop:

Iteration 1: i = 0

  • j = counter(0). The initial value of count is 0, and value is 0. The updated value of count is 0.
  • Therefore, j is assigned the value of 0.

Iteration 2: i = 1

  • j = counter(1). The current value of count is 0, and value is 1. The updated value of count is 1.
  • Therefore, j is assigned the value of 1.

Iteration 3: i = 2

  • j = counter(2). The current value of count is 1, and value is 2. The updated value of count is 3.
  • Therefore, j is assigned the value of 3.

Iteration 4: i = 3

  • j = counter(3). The current value of count is 3, and value is 3. The updated value of count is 6.
  • Therefore, j is assigned the value of 6.

Iteration 5: i = 4

  • j = counter(4). The current value of count is 6, and value is 4. The updated value of count is 10.
  • Therefore, j is assigned the value of 10.

Iteration 6: i = 5

  • j = counter(5). The current value of count is 10, and value is 5. The updated value of count is 15.
  • Therefore, j is assigned the value of 15.

After the for loop, the value of j is printed using printf. Therefore, the output of the code will be:

J = 15

So, the correct answer is D) 15.

Determine Output : struct node { int a; int b; int c; }; int main() { struct node s= { 3, 5,6 }; struct node pt = &s; printf("Ans : %d" , *(int)pt); return 0; }

  1. 4

  2. 5

  3. 3

  4. Compile error


Correct Option: C

Determine Output: int main() { int a[5] = {1,2,3,4,5}; int ptr = (int)(&a+1); printf("%d %d" , *(a+1), *(ptr-1) ); return 0; }

  1. 2,1

  2. 2,5

  3. compile error

  4. 2,2


Correct Option: B

Determin Output: int main() { int a, b,c, d; a=3; b=5; c=a,b; d=(a,b); printf("c = %d" ,c); printf("\n\nd = d" ,d); return 0; }

  1. 5,5

  2. 3,3

  3. 3,5

  4. Error


Correct Option: C

Determine Output: main() { printf("%x",-1<<4); }

  1. -16

  2. fff0

  3. 0

  4. 0010


Correct Option: B

The symbol "?" belongs to which operator?

  1. Conditional Operator

  2. Bitwise Operators

  3. Logical operators

  4. Relational Operator


Correct Option: A
Explanation:

To solve this question, the user needs to have a basic understanding of the different types of operators used in programming languages.

The symbol "?" is known as the conditional operator.

Option A: Conditional Operator - This option is correct. The conditional operator, also known as the ternary operator, is represented by the symbol "?". It is a shorthand way of writing an if-else statement in a single line of code.

Option B: Bitwise Operators - This option is incorrect. Bitwise operators are used to perform operations on individual bits of a number. Examples include AND, OR, NOT, and XOR.

Option C: Logical Operators - This option is incorrect. Logical operators are used to combine multiple conditions. Examples include AND, OR, and NOT.

Option D: Relational Operator - This option is incorrect. Relational operators are used to compare two values. Examples include , <=, >=, ==, and !=.

Therefore, the answer is: A. Conditional Operator

A class is

  1. Data Type

  2. Abstract Type

  3. User Defined Type

  4. All of these options


Correct Option: C

A recursive function would result in infinite recursion, if the following were left out:

  1. Base case

  2. Recursive call

  3. Subtraction

  4. Local variable declarations


Correct Option: B

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) Base case - This option is incorrect. The base case is an essential part of a recursive function. It provides a condition that allows the function to terminate and prevents infinite recursion.

Option B) Recursive call - This option is correct. The recursive call is the part of the recursive function that calls itself. Without a recursive call, the function would not be able to repeat the process and would not result in infinite recursion.

Option C) Subtraction - This option is incorrect. The specific operation performed in the recursive function (such as subtraction) does not determine whether the function will result in infinite recursion or not.

Option D) Local variable declarations - This option is incorrect. Local variable declarations are not directly related to whether a recursive function will result in infinite recursion or not. They are used to store and manipulate data within the function but do not affect the recursion itself.

The correct answer is Option B) Recursive call. This option is correct because without a recursive call, the function would not be able to repeat the process and would not result in infinite recursion.

UML stands for

  1. Unique modeling language.

  2. Unified modeling language

  3. Unified modern language

  4. Unified master laqnguage


Correct Option: B

This operator returns the size in bytes of that data type or object or structure etc

  1. Conditional Operator

  2. Bitwise Operators

  3. sizeof () operator

  4. Relational Operator


Correct Option: C

Exit is a function defined in the cstdlib library.

  1. True

  2. False


Correct Option: A

AI Explanation

To answer this question, you need to understand the concept of libraries in C++.

A library is a collection of pre-compiled code that can be used by programmers to perform specific tasks. The cstdlib library, also known as the C Standard Library, is a library in C++ that provides functions for performing various operations, such as memory allocation, random numbers, and mathematical operations.

The function "exit" is indeed a function defined in the cstdlib library. It is used to terminate a program and return a specified exit code. By calling the "exit" function, you can immediately exit the program and return control to the operating system.

Therefore, the correct answer is:

Option A) True - This option is correct because "exit" is a function defined in the cstdlib library.

- Hide questions