Professional Documents
Culture Documents
a. DOS
b. Windows
c. UNIX **
a. Counter.
b. Index_1
c. 1Counter **
a. boys&girls
b. _mycounter.
c. 22455 **
a. Hello
b. WinMain
c. main **
a. */
b. {
c. /* **
d. “
8. What would happen if the semicolon after the variable definition statement were
omitted? (Select one answer)
int index
index = 13;
a. The Opening and Closing braces are aligned with the main()
function.
b. The printf() function are aligned with main() function.
c. Blank spaces align character strings as they will be aligned in the
output.
d. Statements within the main () function statement block are
intended three spaces **
10. Match the type of processing on the left with its corresponding construct on the
right:
11. How many lines of output does this program display? (Select one answer)
a. 5 1. main( )
b. 6 ** 2. {
c. 7 3. int count;
4. count = 0;
5. while (count < 6) {
6. printf("The value of count
is %d\n",count);
7. count = count + 1;
8. }
9. }
12. If a program does not increment the count value how many times is the loop
executed? (Select one answer)
a. 0
b. 6
c. An Infine Number Of Times **
13. If i were assigned a value of 125 would this program produce output? (Select one
answer)
1. main( )
a. Yes ** 2. {
b. No 3. int i;
4. i = 0
5. do {
6. printf("The value of i
is now %d\n",i);
7. i = i+1
8. } while (i < 5);
9. }
14. Place the following in sequence to reflect the execution of a for loop.
15. Match the variable data type on the left with its description on the right.
16. Match the data type on the left with its characteristic on the right.
1. main( )
a. 17.1
2. {
b. 4
3. int a = 2;
c. 17 **
4. float x = 17.1, y = 8.95, z;
5. char c;
6. c = (char)a + (char)x;
7. c = (char)(a + (int)x);
8. c = (char)(a + x);
9. c = a + x;
18. Review the code opposite. What is the value of z after line 6 executes? (Select
one answer)
1. main( )
a. – 13 ** 2. {
b. 11 3. int x = 11,y = 11,z = 11;
c. false 4. char a = 40,b = 40,c = 40;
5. float r = 12.987,s = 12.987,t =
12.987;
6. if (x == y) z = -13;
7. if (x > z) a = 'A';
8. if (!(x > z)) a = 'B';
9. if (b <= c) r = 0.0;
10. if (r != s) t = c/2;
11. if (x = (r != s)) z = 1000;
12. if (x = y) z = 222;
13. if (x != 0) z = 333;
14. if (x) z = 444;
19. Which of the following are comparison operators? (Select multiple answers)
a. >= **
b. <= **
c. !=
d. = **
20. Line 11 is different from line 10. What is the value of r after line 11? (Select one
answer)
1. main( )
2. {
3. int x = 11,y = 11,z = 11;
4. char a = 40,b = 40,c = 40;
Continue…
a. 14.56 5. float r = 12.987,s = 12.987,t = 12.987;
b. 12 **
c. 14.56 6. x = y = z = 77;
d. True 7. if ((x == y) && (x == 77)) z = 33;
e. FALSE 8. if ((x > y) || (z > 12)) z = 22;
9. if (x && y && z) z = 11;
10. if ((x = 1) && (y = 2) && (z = 3)) r =
12.00;
11. if ((x == 2) && (y = 3) && (z = 4)) r =
14.56;
Folder 37122
21. A variable declared outside of the main( ) function is known as a(n) ______________
variable.
a. Local
b. Static
c. Global **
22. Which of the following locations would you choose to declare a local variable
available to the main( ) function? (Select one answer)
a. Class
b. Function
c. Library **
a. Unit1(display)
b. Display(Unit1) **
c. Display() Unit1
d. Unit1. Display;
26. “C” has ______ number of standard keywords in its collection. (Select one answer)
a. 35
b. 32 **
c. 38
27. Which one of the following statements must be true of a variable received by a
function? (Select one answer)
a. It must be of the same data type as the variable passed in the function call.
b. It must be declared before the delimiting braces of the receiving
function* *
c. It must be global variable.
d. It must be declared by the calling function.
28. Which one of the following parts of a program executes after the closing brace of
a called function? (Select one answer)
a. It must be of the same data type as the variable passed in the function
call.
b. It must be declared before the delimiting braces of the receiving
function* *
c. It must be global variable.
29. Which one of the following parts of a program executes after the closing brace of
a called function? (Select one answer)
30. Which of the following statements accurately describes global variables? (Select
multiple answers)
a. Parentheses.
b. Braces. **
c. Semicolon.
32. Which of the following statements accurately describe local variables? (Select
multiple answers)
33. You can prevent a local variable from being deleted when a function terminates
by using the ___________ keyword in the variable declaration.
a. Automatic
b. Static. **
c. Current.
34. A storage area within the CPU that provides high speed access to its contents is
known as a(n) ____________________.
a. Controller
b. Register. **
c. ALU.
35. Which of the following statements accurately describe duplicate variable names?
(Select multiple answers)
a. Parentheses.
b. Semicolon. **
c. Braces.
38. Which one of the following statements accurately describes the #include
directive? (Select one answer)
39. Which of the following statements accurately describe the classic style of
function definition? (Select multiple answers)
40. One of the advantages of using the modern style of function definition
is that you allow the compiler to perform __________________.
a. Debugging.
b. Error Checking **
c. Conversion.
a. Program
b. ItSelf **
c. Function.
a. Address.
b. STACKS **
c. Pointers.
44. Which of the following statements accurately describe the stack? (Select multiple
answers)
45. When two functions call each other, or three or more functions call each other in
a circle, this is known as _____________________recursion.
a. Direct.
b. Indirect **
c. Circular.
47. The statement used to create constants and macros for use in a program is know
as a(n)______________________________.
a. Macros
b. Define Directives **
c. Runtime Macros.
49. You can specify a name that will stand for another value when a program is
executed by defining a(n)________________________.
a. Macros
b. Constant **
c. Identifier.
a. Object Programming
b. Modular/Prcedural **
c. Component Oriented.
51. Which of the following statements accurately describe the advantages of using
symbolic constants? (Select multiple answers)
52. Which one of the following statements accurately describes the use of
parentheses in macros? (Select one answer)
53. Which of the following types of errors can result from misuse or omission of
parentheses in macros? (Select multiple answers)
a. Enumeration Variables. **
b. Global Variables.
c. Local Variables.
a. 0 **
b. 32.
c. 20.
a. Standard **
b. Concept.
c. Extension.
a. String **
b. Array.
c. Enumeration.
59. Which one of the following pieces of information is specified by the subscript at
the end of a character string definition? (Select one answer)
a. EOF.
b. BOF
c. NULL.
61. Which of the following pieces of information are specified by the parameters of
the strcpy( ) function? (Select multiple answers)
62. Which of the following statements accurately describe the strcmp( ) function?
(Select multiple answers)
63. Which of the following statements accurately describe the parameters of the
strcat( ) function? (Select multiple answers)
a. The first parameter specifies the string that will have a new string
added to it.
b. The first parameter specifies the string that will be added to another.
c. The second parameter the string that will have a new string added to it.
d. The second parameter specifies the string that will be added to
other.
65. To specify the third element of the array ingredients[12] you would write
________________________
a. Ingredients.12
b. Ingredients[3]
c. Ingredients[2] **
66. Unlike a character array, an integer array does not require a terminating
___________________________
a. Number
b. Null
c. Character **
67. Which one of the following actions will result when an array declaration does not
specify the array length? (Select one answer)
68. By declaring an array before the main( ) method, you create a(n) _____________
a. Smart Array
b. Local Array
c. Global Array **
a. Elements
b. Arrays
c. Nested **
71. How many subscripts are required for each assignment statement that loads data
into a two-dimensional array element? __________________
a. 4
b. 6
c. 2 **
72. Which of the following elements must be specified in the function header
parameters for a function that receives an array? (Select multiple answers)
73. Which of the following statements accurately describe array data passed
between functions? (Select multiple answers)
a. Macro
b. Address operator.
c. Pointers **
a. Local
b. Automatic Storage **
c. Global
a. void
b. static, auto, register * *
c. extern
a. int abc;
b. typedef int OurInt **
c. char str[10];
78. Conditional Operators use the ___________ and ______________ operators in its
expression.
a. ^ ^
b. ? : **
c. % ;
a. Value Item
b. ?:
c. l value , l value **
d. Increment and Decrement.
a. Conon :
b. Question ?
c. Comma , **
d. semicolon ;
82. What does the following expression evaluate, by omitting all the three
expressions it is possible to set up an ___________________
a. For Loop
b. While Loop
c. Infinite Loop **
83. In a ____________ and a ___________ loops all statement within the loops will be
executed while the conditional expression is true.
a. While, for
b. Dowhile and for
c. While do… while **
84. A __________ loop is generalized while loop and may contain up to _______
expressions.
a. While , 4
b. For, 2 **
c. Do…while , 2
a. Printf(), Scanf()
b. break, contine **
c. for, while
86. A __________ statement permits unconditional branching and its use should be
avoided if possible.
a. break
b. goto **
c. for loop
a. declaration
b. Function **
c. Main()
88. When calling a function the list of constants or variables after the function name
is known as the __________________________list
a. Formal Parameter
b. Actual Parameter **
c. Local Parameter.
a. Format Conversion.
b. Actual Conversion **
c. Actual Conversion.
90. The storage class ________, _________,__________ and _________ can be assigned to
variables.
a. Try, Catch
b. main ( ), void main ( ) **
c. #include, #define.
a. Standard
b. 5 **
c. User defined
a. <math.h> <stio.h>
b. <math.h> <conio.h>
c. <math.h> <stdlib.h> **
94. Array parameters are passed by _______________, therefore, any changes to the
parameter will result in corresponding changes to the arguments.
a. Copy or Value
b. Self.
c. Reference **
95. A ________________ may be given a tag or name, that can be used to declare a
variable of the same structure type.
a. Enumeration
b. Structure **
c. Union.
96. A _____________ can have more then ___________ dimensions.
a. Structure, One
b. Array, One **
c. Union, Two
97. A storage allocation is through the function ______ and _____ found in ________
98. The indirect operator _______ is used to specify the contents of the memory being
pointed at by the pointed variable.
a. &
b. * **
c.
a. Array Address
b. Pointer **
c. Structure.