C was primarily developed as a
- systems programming language
- general-purpose language
- data processing language
- none of the above
Answer - (1) system programming language
C is a
- high-level language
- low-level language
- high-level language with some low-level features
- low-level language with some high-level features
Answer - (3) high-level language with some low-level features
Which of the following comments are not true?
C provides no input-output features
C provides no file access features
C borrowed most of its ideas from BPCl
C provides no features to manipulate composite objects
C provides no file access features
C borrowed most of its ideas from BPCl
C provides no features to manipulate composite objects
- 1 only
- 1,2 and 3
- 1,2,3 and 4
- None of the above
Answer - (4) None of the above
Which of the following are not keywords in C?
- printf
- main
- IF
- none of the above
Answer - (3) IF
C does no automatic array bound checking. this is
- not true always
- false
- C's asset
- C's shortcoming and always true
Answer - (4) C's shortcoming and always true
Any C program
- must contain at least one function
- need not contain any function
- needs input data
- none of the above
Answer - (1) must contain at least one function
Preprocessing is typically done
- either before or at the beginning of the compilation process
- after compilation but before execution
- after loading
- none of the above
Answer - (1) either before or at the beginning of the compilation process
Which of the following comments about the preprocessor directive # are correct?
- It converts the formal argument in the macro definition into a string
- It strips out redundant blanks
- It concatenates adjacent strings if any
- All of the above
Answer - (4) All of the above
In a program, the constant is defined
- before main
- after main
- anywhere, but starting on a new line
- none of the above
Answer - (3) anywhere, but starting on a new line
Choose the correct statement:
- The use of goto enhances the logical clarity of a code
- The use of goto makes the debugging task easier
- Use goto when you want to jump out of a nested loop
- Never use goto
Answer - (3) Use goto when you want to jump out of a nested loop
Which of the following about conditional compilation is not true?
It is taken care of by the compiler.
It is setting the compiler option conditionally
It is Compiling a program based on a condition
It is taken care of by the pre-processor.
It is setting the compiler option conditionally
It is Compiling a program based on a condition
It is taken care of by the pre-processor.
- 2 only
- 3 and 4 only
- 1 and 2
- all of the above
Answer - (2) 3 and 4 only
The minimum number of temporary variables needed to swap the contents of two variables is
- 1
- 2
- 3
- 0
Answer - (4) 0
The purpose of the following program fragment
b = s + b;
s = b - s;
b = b - s;
wheres, be are two integers is to
- transfer the contents of s to b
- transfer the contents of b to s
- exchange(swap) the contents of s and b
- negate the contents of s and b
Answer - (3) exchange(swap) the contents of s and b
If an integer needs two bytes of storage, then the maximum value of an unsigned integer is
- 2^16 - 1
- 2^15 - 1
- 2^16
- 2^15
Answer - (1) 2^16 - 1
If an integer needs two bytes of storage, then the maximum value of a signed integer is
- 2^16 - 1
- 2^15 - 1
- 2^16
- 2^15
Answer - (2) 2^15 - 1
Choose the false statements:
- An identifier may start with an underscore
- An identifier may end with an underscore
- IF is a valid identifier
- The number of significant characters in an identifier is implementation-dependent
Answer - (3) IF is a valid identifier
int i = 5;
is a statement in a C program. Which of the following are true?
- During execution, the value of i may change but not its address
- During execution, both the address and value may change
- Repeated execution may result in different addresses for i
- i may not have an associated address
Answer - (3) Repeated execution may result in different addresses for i
Which of the following comments about the ++ operator are correct?
- It is a unary operator
- The operator can come before or after the operator
- If cannot be applied to an expression and it associated with the right
- All of the above
Answer - (4) All of the above
For the C preprocessor, which of the following is/are true?
takes care of conditional compilation
takes care of macros
takes care of includes files
acts before compilation
- 1 and 2
- 3 only
- 1,2 and 3
- All of the above
Answer - (4) All of the above
The declaration enum cities [Bethlethem, Jericho, Nazareth = 1, Jerusalem] assign the value 1 to
- Bethlehem
- Nazareth
- Bethlehem and Nazareth
- Jericho and Nazareth
Answer - (4) Jericho and Nazareth
Note - More Questions and Answers will be added from time to time.
0 Comments