Home > General Knowledge > Computer Science > Page 3
Q 21.

From the following, choose the correct statements

A)  Constant expressions are evaluated at compile time
B)  String constants can be concatenated at compile time
C)  Size of array must be known at compile time
D)  All of the above
Q 22.

From the following, choose the correct statements

A)  An identifier may start with an underscore
B)  An identifier may end with an underscore
C)  IF is a valid identifier
D)  The number of significant characters in an identifier is implementation dependent
E)  All of the above
Q 23.

The following statements are about EOF. Which of them are true ?

A)  Its value is defined with stdio.h
B)  Its value is implementation dependent
C)  Its value can be negative
D)  Its value should not equal the integer equivalent of any character
E)  All of the above
Q 24.

Study the following program fragment  :

char c=’a’;

while(c++<=’z’)

putchar(xxx);

If the required output is :

abcdefghijklmnopqrstuvwxyz

then xxx should be:

A)  c
B)  c++
C)  c-1
D)  -c
Q 25.

In the following program fragment, s, b are two integers

b = s + b;

s = b – s;

b = b – s;

What does it intend to do ?

 

A)  Transfer the contents of s to b
B)  Transfer the contents of b to s
C)  Exchange (swap) the contents of s and b
D)  Negate the contents of s and b
Answer & Explanation Answer: Exchange (swap) the contents of s and b

Explanation:

View Answer   Discuss

MCQ Type: C, Computer Science, Computer Science, Computer Science, UGC NET

Q 26.

The C language is a :

A)  High level language
B)  Low level language
C)  High level language with some low low level features
D)  Low level language with some high level features
Answer & Explanation Answer: High level language with some low low level features

Explanation:

View Answer   Discuss

MCQ Type: C, Computer Science, Computer Science, Computer Science, UGC NET

Q 27.

The primary reason for developing C language was to treat it as a:

A)  Systems Programming Language
B)  General Purpose Language
C)  Data Processing Language
D)  None of the above
Q 28.

From the following statements, choose the correct one:

A)  Use of goto makes the debugging task easier
B)  Use goto when you want to jump out of a nested loop
C)  Use of goto enhances the logical clarity of a code
D)  Never use goto
Answer & Explanation Answer: Use goto when you want to jump out of a nested loop

Explanation:

View Answer   Discuss

MCQ Type: C, Computer Science, Computer Science, Computer Science, UGC NET

Q 29.

Study the following statements:

for(i=3; i<15; i+=3)

{ printf(“%d”, i);

++i;

}

What will be the output ?

A)  3 6 9 12
B)  3 6 9 12 15
C)  3 7 11
D)  3 7 11 15
Q 30.

The following program fragment:

int a= 4, b= 6;

printf(“%d”,a=b);

 

A)  Outputs an error message
B)  Prints 0
C)  Prints 1
D)  None of the above