Docsity

Exam I MCQs Unsolved - Structured in C Programming | CSCE 206, Exams of Computer Science

Toggle sidebar
bg1
– Form B –
True/False Questions:
1. The following line will not make any problem in compiling. T
x = y /*divide y by z*/ / z ;
2. Compilers translate and execute each program statement dynamically. F
3. A Program Counter is a type of special – purpose memory cell which contains the instruction
currently being processed. F
4. Linker creates object program and stores it on disk. F
5. The following two expressions are equivalent. T
A /= B; A = A / B;
6. Each preprocessing directive MUST be on its own line, although # is used as the beginning of a
preprocessing directive. T
7. Global variables are stored in HEAP. F
8. Is this TRUE or FALSE: !!10 T
9. A4C in hex is 101000011100 in binary. F
10. Both break and continue statement exit inner loop immediately and statement right after loop is
executed. F
11. The code below will print “Howdy!” for 10 times. F
for(i=0; i<=10; i++)
printf("Howdy!\n");
12. A for loop like the following: F
int x;
for(x = 1 ; x < 3; x++){
…
}
works the same as:
int x=1;
while(x++){
…
x<3;
}
13. A modem allows computers to transmit data over telephone lines. T
14. When designing a program, one could start with smallest parts and then proceed to larger parts.
This type of process is known as Bottom – up Modular design. T
15. Reserved keywords can also be used as variable name only if it is not used elsewhere in program.
F
Multiple Choice Questions:
16. Which of the following contain pre-written functions that can be used by programmers:
C
A. objects
B. objective files
C. libraries
pf3
pf4
pf5
pf8

Partial preview of the text

Download Exam I MCQs Unsolved - Structured in C Programming | CSCE 206 and more Exams Computer Science in PDF only on Docsity!

– Form B –

True/False Questions:

  1. The following line will not make any problem in compiling. T x = y /divide y by z/ / z ;
  2. Compilers translate and execute each program statement dynamically. F
  3. A Program Counter is a type of special – purpose memory cell which contains the instruction currently being processed. F
  4. Linker creates object program and stores it on disk. F
  5. The following two expressions are equivalent. T A /= B; A = A / B;
  6. Each preprocessing directive MUST be on its own line, although # is used as the beginning of a preprocessing directive. T
  7. Global variables are stored in HEAP. F
  8. Is this TRUE or FALSE: !!10 T
  9. A4C in hex is 101000011100 in binary. F
  10. Both break and continue statement exit inner loop immediately and statement right after loop is executed. F
  11. The code below will print “Howdy!” for 10 times. F for(i=0; i<=10; i++) printf("Howdy!\n");
  12. A for loop like the following: F int x; for(x = 1 ; x < 3; x++){ … } works the same as: int x=1; while(x++){ … x<3; }
  13. A modem allows computers to transmit data over telephone lines. T
  14. When designing a program, one could start with smallest parts and then proceed to larger parts. This type of process is known as Bottom – up Modular design. T
  15. Reserved keywords can also be used as variable name only if it is not used elsewhere in program. F

Multiple Choice Questions:

  1. Which of the following contain pre-written functions that can be used by programmers:

C A. objects B. objective files C. libraries

D. executables E. data files

  1. All of the following are punctuators except: C

A. commas , B. semicolons ; C. quotation marks " D. brackets { } E. parenthesis ( )

  1. The following are relational operators or logical operators except: D

A. && B. == C.! D. ^ E. >

  1. Which of the following line is NOT correct D int main(void) { char str[80]; // Line A printf("Enter a string: "); // Line B scanf("%s", str); // Line C printf("Here's your string: %s", str[0]); // Line D return 0; // Line E } A. Line A B. Line B C. Line C D. Line D E. Line E
  2. Which of the following line is correct? C A. printf("I like %c %s", "c", "very much!"); B. printf("I like %s %c", 'c', "very much!"); C. printf("I like %s %s", "c", "very much!"); D. printf("I like %c %c", 'c', "very much!"); E. printf("I like ", "c", "very much!");

E. 0 1 2 3 4

  1. Which of the following is correct variable initialization? B

A. int a = 'b'; B. char A = '8'; C. int A[15] = "Mary"; D. float f = f * 2.0; E. string a = "First";

  1. Variable declaration enables the compiler to: D

A. set aside the appropriate amount of memory to hold the variable B. determine what operations are permissible with that variable C. determine What sort of data is allowed to be stored in that variable D. All of the above E. None of the above

  1. A line of code that describes a functions name, return type, and parameters is called a

B A. declaration B. function prototype C. function definition D. variable declaration E. function directive

  1. Which of the following is not a C binary arithmetic Operator? D

A. * B. + C. / D. ++ E. %

  1. Which one of the following is illegal? C A. +cnt--; B. ++i+j; C. ++(b-a); D. (--j+3); E. +i;
  2. Which is the value of variable final after execution of following statements? D

int a = 371, b = 60, c = 2; int final = (a%60)*c; A. 12 B. 20 C. 0 D. 22 E. 1

  1. What is the output of the following code? E int x = 14, y = 3; printf("%d, %d", x % y, x/y); A. 1, B. 2, C. 1,2. D. 2, E. 2,
  2. Pick the row which has an error from the true/false table of the logical operator B p q p||q A. 0 0 0 B. 1 0 0 C. 0 1 1 D. 1 1 1 E. none of above
  3. Which of the following is the correct order of the Software Life Cycle?: C

A. Design, Testing, Implementation, Analysis, Maintenance B. Analysis, Design, Testing, Maintenance, Implementation C. Analysis, Design, Implementation, Testing, Maintenance D. Design, Analysis, Implementation, Maintenance, Testing E. Analysis, Testing, Design, Implementation, Maintenance

  1. Each of the following are valid identifiers except: D A. LOL B. M C. valid_identifier D. 2nd E. Feb

B. 100

C. 72

D. 27

E. 98

  1. What is the role of BUS? C

A. To store dynamic, volatile data B. To perform arithmetic computations C. To transfer bits between CPU and Memory D. To distribute computation E. None of the above

  1. What is the role of ALU? B

A. To read the individual program B. To perform arithmetic computations and logical operations C. To execute the instruction D. To retrieve a copy of the program command E. None of the above

  1. Which of the following is a legal assignment statement in C language: A

A. y = x = 3; B. y == x; C. y * 3 = x + 2; D. (- y) = (- x); E. 2y = b;

  1. What is the value of j after the following expressions are executed? D int i, j = 5; j = (i = 10) && j; A. - B. 0 C. 10 D. 1 E. 15
  2. What is the value of j after the following expressions are executed? C

int j, i = 2; j = i || (j = 10); A. -

B. 0

C. 1

D. 10

E. 2

  1. A program that controls the processing of the machine is a: E A. Translator B. Compiler C. Word Processor D. Machine Processor E. Operating system
  2. Which of the following translate and execute each program statement dynamically? B A. Keywords B. Interpreters C. Loaders D. Translators E. Operating Systems
  3. Techniques of shared processing over networks are generally called: D A. Remote computing B. Sharing C. Parallel programming D. Distributed computing E. None of the above
  4. A switch statement REQUIRES which of the following: C

A. a break at the end of the switch statement to exit B. a break after every case C. an expression to test the cases against D. a default statement at the end E. all of the above are required