Alien head

Computer Basics - 3

Description: Computer Basics Mix Test - 3
Number of Questions: 15
Created by:
Tags: Computer Basics Mix Test - 3 IT Companies
Attempted 0/15 Correct 0 Score 0

Which of the following data types is not defined in Standard C++?

  1. Char

  2. Int

  3. Real

  4. Bool


Correct Option: C
Explanation:

There is no data type by the name Real in Standard C++.To store real number, we either use float or double data type.

Which of the following is not a relational operator?

  1. >

  2. <

  3. > =

    • =
  4. None of these


Correct Option: D
Explanation:

+= is not a relational operator but a compound assignment operator which assigns the result of addition of the first and the second operand to the first operand.

Which of the following is not a looping statement in C++?

  1. While

  2. For

  3. Until

  4. Do


Correct Option: C
Explanation:

Until is not defined in C++ language.

Linked list is a ............

  1. Linear Data Structure

  2. Non-Linear Data Structure

  3. Both of these

  4. None of these


Correct Option: C
Explanation:

 According to the way, linked list is accessed, it is linear data structure and according to storage, linked list is a non-linear data structure. Hence this is the answer.

Which of the following is possible number of nodes in complete binary tree?

  1. 8

  2. 15

  3. 17

  4. 21


Correct Option: B
Explanation:

 The number of nodes in complete binary tree of n nodes is 2n - 1 and 15 = 24 - 1, so this is the only possible value in all options.So this is the answer.

What is the functionality of break statement?

  1. To exit from the program.

  2. To exit from the loop.

  3. To end the current iteration and jump to the next iteration.

  4. None of these


Correct Option: B
Explanation:

Break statement is used for exiting from the loop, hence this is the answer.

What is the meaning of enqueue?

  1. Adding an element in stack

  2. Adding an element in queue

  3. Removing an element from stack

  4. Removing an element from queue


Correct Option: B
Explanation:

Enqueue means adding an element in queue, hence this is the answer.

Which of the following is used to terminate a process in Unix?

  1. ctrl-z

  2. ctrl-c

  3. vi

  4. fg


Correct Option: B
Explanation:

 ctrl-c is used to terminate the process.

Which of the following commands displays all the files in the directory?

  1. ps

  2. wc

  3. ls

  4. who


Correct Option: C
Explanation:

 ls is used to list files in the directory.

The octal value of 7 with reference to permission of a file signifies

  1. Read Permission

  2. Write permission

  3. Execute permission

  4. All of these


Correct Option: D
Explanation:

The octal value 7 corresponds to read and write as well as executes permission.

The command pwd is used to

  1. change the directory

  2. create new directory

  3. obtain the absolute pathname for current working directory

  4. none of these


Correct Option: C
Explanation:

 pwd is used to get the current working absolute path.

Which of the following can be used to represent hierarchical relationship between elements?

  1. Dequeue

  2. Array

  3. Tree

  4. All of these


Correct Option: C
Explanation:

InTree, there is hierarchical relationship as there is parent and child relationship.

How many different trees are possible with nine nodes?

  1. 1014

  2. 1013

  3. 503

  4. 511


Correct Option: C
Explanation:

There are 2n -n possible trees for n nodes, so number of nodes is 29 -9 =503. Hence, this is the answer.

What will be the output of following program? #include <cstdlib> #include <iostream> using namespace std; int main() { int k =1; for(int i=1;i<=1;i++) printf(%d,k++); printf(%d,k); system(PAUSE);
return 0;

  1. 22

  2. 11

  3. 12

  4. compile error


Correct Option: C
Explanation:

Post increment effect only comes in the next statement. so first printf will print1 and in the next printf, only 2 will be printed. So12 will be displayed on screen.Hence, this is the answer.

What will be the output of following program? #include <cstdlib> #include <iostream> using namespace std; int main() { int p; p = 1,2,3; printf(%d,p); system(PAUSE);
return 0;

  1. 1

  2. 2

  3. 3

  4. garbage value

  5. compile error


Correct Option: A
Explanation:

The operands to comma operator are evaluated from left to right and we also know that assignment operator takes precedence over comma operator so first x=1 is evaluated and then x =2,3 is evaluated. Hence output would be 1

+ View questions