The area bounded by the parabola \(y = x^2 + 2\) and the lines \(y = x\), \(x = 1\) and \(x = 2\) (in square units) is:
What is the output of the following C code?
void foo(int *p, int x) { *p = x; } void main() { int *z; int a = 20, b = 25; z = a; // Incorrect: Should be z = a; foo(z, b); printf("%d", a); }
Issue: The statement z = a;
is invalid because a
is an integer, and z
is a pointer.
Which of the following is the greatest? \[ 0.6, \ 0.666, \ \frac{5}{6}, \ \frac{2}{3} \]
Consider the following C code:
int main() { sum = 0; for (n = 1; n < 3; n++) { n++; sum += g(f(n)); } printf("%d", sum); } int g(n) { return 10 + n; } int f(n) { return g(2 * n); }
What is the output?