CSE 240 - FINAL REVIEW QUESTIONS WITH VERIFIED
ACCURATE ANSWERS
Syntactic Structure: Imperative Programming - Answers - Conditional statements;
loop statements;
variable declaration
Interpretation of a program is the direct execution of one statement at a time
sequentially. (T/F) - Answers - True
Functional programming languages are low-level languages. (T/F) - Answers - False
Programming language uses two-step translation with intermediate codes for execution.
- Answers - Java
What is a data type? - Answers - a set of primary values and the operations defined on
these values.
The compiler executes the program (T/F). - Answers - False
Semantic structure: Imperative Programming - Answers - type matching;
parameters type in a function declaration should match these in the function call;
unicity
Compilation of a program is to execute all the statements of the program completely.
(T/F) - Answers - False
During compilation, all the statements of a program in high-level language are
converted (translated) to a low-level language. (T/F) - Answers - True
Lexical structure of all programming languages include: - Answers - identifiers
keywords
operators
literals
(C Programming)
What is the output of the code below:
#include <stdio.h>
int fun (int n) {
if (n == 4)
return n;
else
, return 2*fun(n+1);
}
int main() {
printf("%d", fun(3));
return 0;
} - Answers - 8
(C Programming)
What is printed by the following code:
#include <stdio.h>
int i=10;
int bar(int m, int *n) {
printf("i=%d k=%d l=%d\n", i,m,*n);
}
int foo(int k, int *l) {
printf("i=%d k=%d l=%d\n", i,k,*l);
k = 3;
*l = 4;
bar(k, l);
}
int main() {
int j = 15;
foo(j, &i);
printf("i=%d j=%d\n", i, j);
return 0;
} - Answers - i = 10 k = 15 l = 10
i=4k=3l=4
i = 4 j = 15
(C Programming)
Define the term: Data Type - Answers - a classification specifies which type of value a
variable has and what type of mathematical, relational or logical operations can be
applied to it.
(C Programming)
Define the term: Variable - Answers - a name given to a storage location.
(C Programming)
Define the term: Constant - Answers - fixed value that the program may not alter during
its execution.
(C Programming)
ACCURATE ANSWERS
Syntactic Structure: Imperative Programming - Answers - Conditional statements;
loop statements;
variable declaration
Interpretation of a program is the direct execution of one statement at a time
sequentially. (T/F) - Answers - True
Functional programming languages are low-level languages. (T/F) - Answers - False
Programming language uses two-step translation with intermediate codes for execution.
- Answers - Java
What is a data type? - Answers - a set of primary values and the operations defined on
these values.
The compiler executes the program (T/F). - Answers - False
Semantic structure: Imperative Programming - Answers - type matching;
parameters type in a function declaration should match these in the function call;
unicity
Compilation of a program is to execute all the statements of the program completely.
(T/F) - Answers - False
During compilation, all the statements of a program in high-level language are
converted (translated) to a low-level language. (T/F) - Answers - True
Lexical structure of all programming languages include: - Answers - identifiers
keywords
operators
literals
(C Programming)
What is the output of the code below:
#include <stdio.h>
int fun (int n) {
if (n == 4)
return n;
else
, return 2*fun(n+1);
}
int main() {
printf("%d", fun(3));
return 0;
} - Answers - 8
(C Programming)
What is printed by the following code:
#include <stdio.h>
int i=10;
int bar(int m, int *n) {
printf("i=%d k=%d l=%d\n", i,m,*n);
}
int foo(int k, int *l) {
printf("i=%d k=%d l=%d\n", i,k,*l);
k = 3;
*l = 4;
bar(k, l);
}
int main() {
int j = 15;
foo(j, &i);
printf("i=%d j=%d\n", i, j);
return 0;
} - Answers - i = 10 k = 15 l = 10
i=4k=3l=4
i = 4 j = 15
(C Programming)
Define the term: Data Type - Answers - a classification specifies which type of value a
variable has and what type of mathematical, relational or logical operations can be
applied to it.
(C Programming)
Define the term: Variable - Answers - a name given to a storage location.
(C Programming)
Define the term: Constant - Answers - fixed value that the program may not alter during
its execution.
(C Programming)