Question 21
i = 0;
j = 1;
while (j < n )
{
if (E) j++;
else if (a[j] - a[i] == S) break;
else i++;
}
if (j < n)
printf(\"yes\")
else
printf (\"no\");
Choose the correct expression for E.
Question 22
Question 23
#include <stdio.h>
int main () {
int sum = 0, maxsum = 0, i, n = 6;
int a [] = {2, -2, -1, 3, 4, 2};
for (i = 0; i < n; i++) {
if (i == 0 || a [i] < 0 || a [i] < a [i - 1]) {
if (sum > maxsum) maxsum = sum;
sum = (a [i] > 0) ? a [i] : 0;
}
else sum += a [i];
}
if (sum > maxsum) maxsum = sum ;
printf (\"%d\\n\", maxsum);
}
Question 24
Question 25
A: array [1 ... 10] [1 ... 15] of integer;Assuming that each integer takes one memory location, the array is stored in row-major order and the first element of the array is stored at location 100, what is the address of the element a[i][j] ?
Question 26
Question 27
Question 28
Question 29
# include <stdio.h>
int main ()
{
char a [6] = \"world\";
int i, j;
for (i = 0, j = 5; i < j; a [i++] = a [j--]);
printf (\"%s\\n\", a);
}
/* Add code here. Remove these lines if not writing code */
Question 30
#include <stdio.h>
int main ()
{
int i, j;
int a [8] = {1, 2, 3, 4, 5, 6, 7, 8};
for(i = 0; i < 3; i++) {
a[i] = a[i] + 1;
i++;
}
i--;
for (j = 7; j > 4; j--) {
int i = j/2;
a[i] = a[i] - 1;
}
printf (\"%d, %d\", i, a[i]);
}
/* Add code here. Remove these lines if not writing code */
There are 37 questions to complete.