C/C++/OS/DS/Networking Test Set 2

1)   Trace the output.

     #define no 5+3

int main()
{
int result;
result=no*no*no;
printf("%d",result);
return 0;
}


a. 512
b. 38
c. Compile time error.
d. None of the above
Answer  Explanation 

ANSWER: 38

Explanation:
No explanation is available for this question!


2)   What would be the equivalent pointer expression for referring the array?

arr[p][q][r][m]


a. * (*(*(*(arr+p)+q)+r)+m)
b. arr[0];
c. *((((arr+p)+q)+r)+m)
d. None of the above.
Answer  Explanation 

ANSWER: * (*(*(*(arr+p)+q)+r)+m)

Explanation:
No explanation is available for this question!


3)   Trace the output.

int main()
{
int a=5;
printf("%d %d %d", a ,a++, ++a);
return 0;
}


a. 5, 6, 7
b. 7, 6, 6
c. 5, 6, 6
d. None of the above.
Answer  Explanation 

ANSWER: 7, 6, 6

Explanation:
No explanation is available for this question!


4)   Trace the output.

int main()
{
char *str="careerride";
printf("%d",printf("%s",str));
return 0;
}


a. 10careerride
b. careerride
c. careerride10
d. Compile time error.
Answer  Explanation 

ANSWER: careerride10

Explanation:
No explanation is available for this question!


5)   What is keywords in c?

a. keywords have predefined meanings and user can change its value at compile time.
b. keywords have predefined meanings and cannot be changed.
c. There is no predefined value of keywords. User provides these values at runtime only.
d. None of the above.
Answer  Explanation 

ANSWER: keywords have predefined meanings and cannot be changed.

Explanation:
No explanation is available for this question!


6)   The C language is.

a. A context sensitive language
b. A regular language
c. A context free language
d. None of the above.
Answer  Explanation 

ANSWER: A context free language

Explanation:
No explanation is available for this question!


7)   C++ : Which of the following statement is correct?

a. Constructor has same name as its class name.
b. A constructor is called at the time of object creation.
c. Default constructor has no parameter.
d. All of the above.
Answer  Explanation 

ANSWER: All of the above.

Explanation:
No explanation is available for this question!


8)   C++ : Trace the output.

classMyClass
{
public:
~ MyClass( )
{

cout << "MyClass destructor is called" << endl;

}
};

void main( )

{
MyClass s;
s.~MyClass( );
}


a.
MyClass destructor is called
MyClass destructor is called
b. MyClass destructor is called
c. Compile time error
d. None of the above
Answer  Explanation 

ANSWER:
MyClass destructor is called
MyClass destructor is called

Explanation:
No explanation is available for this question!


9)   Which of the following is correct about function overloading?

a. The no of arguments should be different.
b. The type of arguments should be different.
c. Both A and B.
d. None of the above.
Answer  Explanation 

ANSWER: Both A and B.

Explanation:
No explanation is available for this question!


10)   Which of the following is correct about structure in c++?

a. structure does not support inheritance but class supports.
b. class data members are private by default while structures are public by default.
c. structure cannot be declared as abstract.
d. All of the above.
Answer  Explanation 

ANSWER: All of the above.

Explanation:
No explanation is available for this question!


11)   Which is the implementation of the swap function?

1.

void swap (int a, int b)
{
int temp;
temp = a;
a = b;
b = temp;
}
int main () {
int i = 0, j = 1;
swap (i, j);
}


2.

void swap (int&a, int&b) {
int temp;
temp = a;
a = b;
b = temp;
}
int main () {
int i = 0, j = 1;
swap (i, j);
}

3.

void swap (int *a, int *b)
{
int *temp;
temp = a;
a = b;
b = temp;
}
int main () {
int i = 0, j = 1;
swap (&i, &j);
}


a. 3 Only
b. 2 Only
c. 2 and 3 only
d. None of the above.
Answer  Explanation 

ANSWER: 2 Only

Explanation:
No explanation is available for this question!


12)   Trace the output

enumcolour {  green, red, blue=10, white, yellow, pink    };

int main()
    {
cout << green << " ," << red << " ," << blue << " ," << white << " ," << yellow << " ," << pink;
return 0;
    }


a. 10, 11, 12, 13
b. 8, 9, 10, 11, 12, 13
c. 0, 1, 10, 11, 12, 13
d. None of the above
Answer  Explanation 

ANSWER: 0, 1, 10, 11, 12, 13

Explanation:
No explanation is available for this question!


13)   Which of the following is correct regarding process in operating system?

a. a program is a passive entity
b. process is an active entity.
c. A process is the unit of work.
d. All of the above.
Answer  Explanation 

ANSWER: All of the above.

Explanation:
No explanation is available for this question!


14)   The main function of the command interpreter is

a. To handle the compiler.
b. To handle the parser.
c. To get and execute the next user-specified command.
d. None of the above.
Answer  Explanation 

ANSWER: To get and execute the next user-specified command.

Explanation:
No explanation is available for this question!


15)   Operating System provides the different types of services to the user. For accessing these services, the interface is provided by the

a. system calls.
b. Application Programming Interface.
c. Native library.
d. None of the above.
Answer  Explanation 

ANSWER: system calls.

Explanation:
No explanation is available for this question!


16)   The procedure of starting a computer by loading the kernel is known as

a. Starting of kernel
b. Booting the system.
c. Loading the API.
d. None of the above.
Answer  Explanation 

ANSWER: Booting the system.

Explanation:
No explanation is available for this question!


17)   Your system response time is very poor. What may be the reason?

a. Process is busy
b. I/O rates may be high
c. High paging rates
d. All of the above
Answer  Explanation 

ANSWER: All of the above

Explanation:
No explanation is available for this question!


18)   How you will describe Throughput in operating system?

a. Number of times a program produces output.
b. Number of times the program is running.
c. Number of programs processed by it per unit time
d. None of the above.
Answer  Explanation 

ANSWER: Number of programs processed by it per unit time

Explanation:
No explanation is available for this question!


19)   In which tree, for every node the height of its left subtree and right subtree differ almost by one?

a. Binary search tree
b. AVL tree
c. Threaded Binary Tree
d. Complete Binary Tree
Answer  Explanation 

ANSWER: AVL tree

Explanation:
No explanation is available for this question!


20)   If a binary tree has height 10 then what is the maximum number of nodes in that tree?

a. 1000
b. 1023
c. 1024
d. 1002
Answer  Explanation 

ANSWER: 1023

Explanation:
No explanation is available for this question!


21)   In a binary tree you have deleted a node that have two children then it is replaced by its

a. Preorder predecessor
b. Inorder predecessor
c. Inorder successor
d. None of the above
Answer  Explanation 

ANSWER: Inorder successor

Explanation:
No explanation is available for this question!


22)   For evaluation the postfix expression which data structure you will use?

a. Stack
b. Queue
c. List
d. Tree
Answer  Explanation 

ANSWER: Stack

Explanation:
No explanation is available for this question!


23)   The search time in hashing is

a. O(n)
b. O(logn)
c. O(nlogn)
d. O(1)
Answer  Explanation 

ANSWER: O(1)

Explanation:
No explanation is available for this question!


24)   What is the postfix form of the following prefix *+pq-rs

a. pq+rs-*
b. pqrs+*-
c. pq+*rs-
d. None of the above.
Answer  Explanation 

ANSWER: pq+rs-*

Explanation:
No explanation is available for this question!


25)   From the given below options, which has the unit as bits/second

a. Propagation speed
b. Propagation time
c. Throughput
d. None of the above.
Answer  Explanation 

ANSWER: Throughput

Explanation:
No explanation is available for this question!


26)   An analog signal has a bit rate of 6000 bps and a baud rate of 2000 baud. How many data elements are carried by each signal element?

a. 0.336 bits/baud
b. 3 bits/baud
c. 120,00,000 bits/baud
d. None of the above
Answer  Explanation 

ANSWER: 3 bits/baud

Explanation:
No explanation is available for this question!


27)   The signal rate is called as

a. pulse rate
b. modulation rate
c. baud rate
d. All of the above.
Answer  Explanation 

ANSWER: All of the above.

Explanation:
No explanation is available for this question!


28)   Some IPV4 address is given below, choose the correct option.

a. 22.34.7.8.20
b. 200.56.045.78
c. 200.56.045.78
d. None of the above.
Answer  Explanation 

ANSWER: None of the above.

Explanation:
No explanation is available for this question!


29)   If the maximum amplitude of a sine wave is 4 units, then minimum amplitude is.

a. 4
b. 2
c. 3
d. -4
Answer  Explanation 

ANSWER: -4

Explanation:
No explanation is available for this question!


30)   Which of the following is/are channelization protocol?

a. FDMA (Frequency-Division Multiple Access)
b. TDMA (Time-Division Multiple Access)
c. CDMA (Code-Division Multiple Access)
d. All of the above.
Answer  Explanation 

ANSWER: All of the above.

Explanation:
No explanation is available for this question!