A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

71. Trace the error:

void main( )
{
int *b, &a;
*b = 20
printf(“%d, %d”, a, *b)
}
a. No error
b. Logical error
c. Syntax error
d. Semantic error
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).Syntax error

72. Match the following:

a. calloc( )         i. Frees previously allocated space
b. free( )             ii. Modifies previously allocated space
c. malloc( )        iii. Allocates space for array
d. realloc( )        iv. Allocates requested size of space

Codes:
      a   b   c   d
a. iii   i    iv   ii
b. iii   ii    i   iv
c. iii   iv   i   ii
d. iv   ii   iii   i
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).iii   i    iv   ii

73. printf(“%c”, 100);
a. prints 100
b. prints ASCII equivalent of 100
c. prints garbage
d. none of the above
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).prints ASCII equivalent of 100

74. The ………….. memory allocation function modifies the previous allocated space.
a. calloc( )
b. free( )
c. malloc( )
d. realloc( )
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).realloc( )

75. The goal of operator overloading is
a. to help the user of a class
b. to help the developer of a class
c. to help define friend function
d. None of the above
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).to help the user of a class

76. How many of the following declarations are correct?

int z = 7.0;
double void = 0.000;
short array [2] = {0, 1, 2};
char c = “\n”;
a. None
b. One is correct
c. Two are correct
d. All four are correct
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).Two are correct

77. Which one of the following sentences is true?
a. The body of a while loop is executed at least once.
b. The body of a do … while loop is executed at least once.
c. The body of a do … while loop is executed zero or more times.
d. A for loop can never be used in place of a while loop.
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).The body of a do … while loop is executed at least once.

78. The statement

print f (“ % d”, 10 ? 0 ? 5 : 1 : 12);

will print
a. 10
b. 0
c. 12
d. 1
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).1

79. What will be the output of the following c-code?

void main ( )
{
char *P = "ayqm" ;
char c;
c = ++*p ;
printf ("%c", c);
}
a. a
b. c
c. b
d. q
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).b

80. Member of a class specified as …………… are accessible only to method of the class.
a. private
b. public
c. protected
d. derive
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).private