• +91 9971497814
  • info@interviewmaterial.com

Computer Interview Questions Answers

CPlusPlus Interview Questions Answers

Question - 31 : - What are the defining traits of an object-oriented language?

Answer - 31 : - The defining traits of an object-oriented langauge are: * encapsulation * inheritance * polymorphism

Question - 32 : - What problems might the following macro bring to the application?

Answer - 32 : - #define sq(x) x*x

Question - 33 : - What are the advantages and disadvantages of B-star trees over Binary trees?

Answer - 33 : - 1. B-star trees have better data structure and are faster in search than Binary trees, but it’s harder to write codes for B-start trees. 2. The major difference between B-tree and binary tres is that B-tree is a external data structure and binary tree is a main memory data structure. The computational complexity of binary tree is counted by the number of comparison operations at each node, while the computational complexity of B-tree is determined by the disk I/O, that is, the number of node that will be loaded from disk to main memory. The comparision of the different values in one node is not counted.

Question - 34 : - Write a short code using C++ to print out all odd number from 1 to 100 using a for loop

Answer - 34 : - for( unsigned int i = 1; i < = 100; i++ ) if( i & 0x00000001 ) cout << i << \",\";

Question - 35 : - Give 4 examples which belongs application layer in TCP/IP architecture?

Answer - 35 : - FTP, TELNET, HTTP and TFTP

Question - 36 : - Explain the scope resolution operator.

Answer - 36 : - It permits a program to reference an identifier in the global scope that has been hidden by another identifier with the same name in the local scope.

Question - 37 : - Name some major differences between C++ and Java.

Answer - 37 : - C++ has pointers; Java does not. Java is platform-independent; C++ is not. Java has garbage collection; C++ does not. Java does have pointers. In fact all variables in Java are pointers. The difference is that Java does not allow you to manipulate the addresses of the pointer

Question - 38 : - What’s the output of the following program? Why?

Answer - 38 : - #include <stdio.h> main() { typedef union { int a; char b[10]; float c; } Union; Union x,y = {100}; x.a = 50; strcpy(x.b,\"hello\"); x.c = 21.50; printf(\"Union x : %d %s %f \n\",x.a,x.b,x.c ); printf(\"Union y :%d %s%f \n\",y.a,y.b,y.c); } Given inputs X, Y, Z and operations | and & (meaning bitwise OR and AND, respectively) What is output equal to in output = (X & Y) | (X & Z) | (Y & Z)

Question - 39 : - What’s the meaning of ARP in TCP/IP?

Answer - 39 : - The "ARP" stands for Address Resolution Protocol. The ARP standard defines two basic message types: a request and a response. a request message contains an IP address and requests the corresponding hardware address; a replay contains both the IP address, sent in the request, and the hardware address.

Question - 40 : - Are there any new intrinsic (built-in) data types?

Answer - 40 : - Yes. The ANSI committee added the bool intrinsic type and its true and false value keywords.

Computer Contributors

krishan
Rajeev Katiyar
Yes Baroda

Share your email for latest updates

Name:
Email:

Our partners