Answers Latest Quiz
Syntactic Structure: Imperative Programming ANS Conditional statements;
loop statements;
variable declaration
Interpretation of a program is the direct execution of one statement at a time sequentially. (T/F) ANS True
Functional programming languages are low-level languages. (T/F) ANS False
Programming language uses two-step translation with intermediate codes for execution. ANS Java
What is a data type? ANS a set of primary values and the operations defined on these values.
The compiler executes the program (T/F). ANS False
Semantic structure: Imperative Programming ANS 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) ANS False
During compilation, all the statements of a program in high-level language are converted (translated) to a low-
level language. (T/F) ANS True
Lexical structure of all programming languages include: ANS 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;
} ANS 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;
} ANS i = 10 k = 15 l = 10
i=4k=3l=4
i = 4 j = 15
(C Programming)
Define the term: Data Type ANS 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 ANS a name given to a storage location.
(C Programming)
Define the term: Constant ANS fixed value that the program may not alter during its execution.
(C Programming)
Define the term: Pointer ANS a name given to a storage location that store an address.
(C Programming)
Which code in C is equivalent to this Java code:
int x = 5;
float y = 10.3f;
System.out.println("hello " + x + " bye " + y); ANS int x = 5;
float y = 10.3;