Question
28. How many lines of output will be displayed by the following program fragment? i = 0; do { for (j = 0; j <
28. How many lines of output will be displayed by the following program fragment?
i = 0;
do {
for (j = 0; j < 4; j = j + 1)
printf("%d ", i + j);
i = i + 1;
} while (i < 5);
a. 0
b. 7
c. 9
d. 16
e. 20
29. When a loop statement contains another loop statement it is said to be:
a. nested
b. compound
c. entangled
d. conditional
e. none of the above
30. What is the output from this program?
#include
Void do_something(int *thisp, int that)
{
int the_other;
the_other = 5;
that = 2 + the_other;
*thisp = the_other * that;
}
Int main(void)
{
int first, second;
first = 1;
second = 2;
do_something(&second, first);
printf("%4d%4d ", first, second);
return (0);
}
a. 35 2
b. 1 35
c. 35 7
d. 1 2
e. 0
31. Here is the prototype of a function:
void five(double x, double *yp, int *zp);
Given these variable declarations, which calls to five are valid?
int m, n;
double p, q;
a. five(m, &p, &n);
b. q = five(6.2, &p, &m);
c. five(p, &q, &m);
d. five(7.1, &p, &q);
e. a and c only
32. The * symbol means:
a. multiplication of two operands
b. pointer to in a formal parameter list
c. unary indirection operator to follow a pointer
d. all of the above
e. none of the above
33. Which unary operator is used to access the address of a variable?
a. %
b. #
c. *
d. &
e. !
34. Accessing the contents of memory using a pointer variable that contains the address of that memory location is called:
a. pointer direction
b. cell referencing
c. pointer access
d. indirect reference
e. none of the above
35. What is the minimum valid subscript value for array a?
a. 0
b. 1
c. any negative number
d. There is no minimum.
e. none of the above
36. How many numbers can be stored in the array declared below?
double arr[10][5][6];
a. 21
b. 90
c. 180
d. 300
e. none of the above
37. Searching an array by testing each element in the array using a loop is called a(n) _______ search.
a. random
b. linear
c. looped
d. stacked
e. none of the above
38. What value is returned by the following call to strlen?
strlen("robot")
a. 't'
b. 4
c. 5
d. 6
e. none of the above
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