Question
Which of the following is not part of the structure of a C program? Preprocessor directives Global declarations section Local directives Functions The expression (a
Which of the following is not part of the structure of a C program?
| Preprocessor directives | |
| Global declarations section | |
| Local directives | |
| Functions |
The expression (a * b + c / d - e % f) is evaluated as:
| a * b + c / d - e % f | |
| ((a * (b + c) / (d - e)) % f) | |
| ((a * b + c) / (d - e % f)) | |
| ((a * b) + (c / d) - (e % f)) | |
| ((a * (b + (c / d)) - e) % f) |
Which of the following explicit type casts is valid?
| (float) x = a / b | |
| [float] x = a / b | |
| x = float (a / b) | |
| x = [float] (a / b) | |
| x = (float) (a / b) |
Which of the following answers about statements is true?
| Statements can be null. | |
| Statements must be terminated by a semicolon. | |
| Statements cannot have side effects. | |
| A compound statement is enclosed in brackets ([ ]). | |
| Expressions are automatically statements. |
Which of the following expressions is not a unary expression?
| x | |
| sizeof(x) | |
| +x | |
| -x | |
| float(x) |
Which of the following statements about a function call is false?
| A function call is a postfix expression. | |
| The operand in a function call is the function name. | |
| The parameter list contains the formal parameters. | |
| The parameter list must match the function headers parameters in type and order. | |
| The value of the call of a void function cannot be assigned. |
The statement that transfers to the testing expression in while or do...while statements and the update in a for statement is:
| break | |
| continue | |
| goto | |
| comma | |
| recursion |
Which of the following statements about post-test loops is true?
| Initialization is found in the body of the loop. | |
| The loop actions are executed before the control expression. | |
| If the loop control expression is false, the loop terminates. | |
| If the loop control expression is false, the action is not executed. | |
| In C, the update is a part of the loop statement itself. |
Which of the following statements about counter-controlled loops is true?
| They can be used only when the number of times the loop is to be repeated is known before the loop starts. | |
| The number of times the loop is to be executed must be a constant. | |
| The update in a counter-controlled loop is an increment. | |
| They cannot be used when the limit is a calculated value. | |
| The counter must be initialized as the first statement in the loop body. |
Which of the following statements about files is false?
| Files are stored in primary storage devices. | |
| Files are a collection of related data treated as a unit. | |
| Data moves from the file to memory through a buffer. | |
| It is the programmers job to test for end of file on an input file. | |
| Files must be named using the operating systems rules. |
Which of the following C statements reads a character, an integer, and a real in that order?
| %c, %d, %f | |
| %c, %d, %r | |
| %c%d%r | |
| %c %d %f | |
| %cdr |
Which of the following statements about the append mode is false?
| A file opened in the append mode may be read from or written to. | |
| The file is initially opened in the write state. | |
| If the file does not exist, an error is returned. | |
| The file marker is positioned at the end of the file. |
The file mode that opens an existing file with the file marker positioned at the end of file is:
| a | |
| e | |
| r | |
| w | |
| z |
Which of the following format codes formats data into a short integer variable?
| i | |
| hi | |
| hh | |
| li | |
| lli |
Which of the following format specifications can be used to read the following input?
15 X 5.4
| %d%c%f | |
| %d%c%9.4f | |
| %d %c %.4f | |
| %d %c %9f |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started