int x = 1; int y = 2; int z = 3; if (x < y) { if (y > 4) { z = 5; } else { z = 6; } }
int nums1[LENGTH] = { 1, -5, 2, 0, 4, 2, -3 }; int nums2[LENGTH] = { 1, -5, 2, 4, 4, 2, 7 }; int result = 0; int j = 0; while (j < LENGTH) { if (nums1[j] != nums2[j]) { result = result + 1; } j = j + 1; }
int number[LENGTH]; ... int result = 0; int j = 0; while ( j < LENGTH) { if (number[j] < 0) { result = result + 1; } j++; }
#include <stdio.h> #define NINE 9 int nine (int n); int nein (int n); int main (int argc, char *argv[]) { int Nine = 3; printf ("%d\n", nine (Nine)); return !NINE; } int nein (int nein) { return ( !(nein == ((NINE*nein) % NINE)) ); } int nine (int Nein) { int Nine = NINE; while (nein (Nine)) { Nine += Nein; Nine = Nine % NINE; } return Nine; }
int f(int *x, int y);Which of the following statements is true of argument `x`? What about variable y?
.[A] it is passed by magic .[B] It is passed by copying .[C] It is passed by reference .[D] It is passed by abstraction .[E] None of the above
More past papers are available at the following link.