void myFunc (int x)
{
if (x > 0)
myFunc(--x);
printf("%d, ", x);
}
int main()
{
myFunc(5);
return 0;
}
#define MAX_NUM 15
Referring to the sample above, what is MAX_NUM
int x = 2 * 3 + 4 * 5;
What value will x contain in the sample code above?
Which one of the following provides conceptual support for function calls?
int i,j;
int ctr = 0;
int myArray[2][3];
for (i=0; i<3; i++)
for (j=0; j<2; j++)
{
myArray[j][i] = ctr;
++ctr;
}
int x = 0;
for (x=1; x<4; x++);
printf("x=%d\n", x);
int x = 3;
if( x == 2 );
x = 0;
if( x == 3 )
x++;
else x += 2;
char *ptr;
char myString[] = "abcdefg";
ptr = myString;
ptr += 5;
What string does ptr point to in the sample code above?
int x = 5;
int y = 2;
char op = '*';
switch (op)
{
default : x += 1;
case '+' : x += y; /*It will go to all the cases*/
case '-' : x -= y;
}
x = 3, counter = 0;
while ((x-1))
{
++counter;
x--;
}
char ** array [12][12][12];
Consider array, defined above. Which one of the following definitions and initializations of p is valid?
Which one of the following is a true statement about pointers?
short testarray[4][3] = { {1}, {2, 3}, {4, 5, 6} };
printf( "%d\n", sizeof( testarray ) );
char buf [] = "Hello world!";
char * buf = "Hello world!";
In terms of code generation, how do the two definitions of buf, both presented above, differ?
Which one of the following Standard C functions can be used to reset end-of-file and error conditions on an open stream?
int i = 4;
switch (i)
{
default:
;
case 3:
i += 5;
if ( i == 8)
{
i++;
if (i == 9) break;
i *= 2;
}
i -= 4;
break;
case 8:
i += 5;
break;
}
printf("i = %d\n", i);
What does the "auto" specifier do?
How do you include a system header file called sysheader.h in a C source file?
int x = 0;
for ( ; ; )
{
if (x++ == 4)
break;
continue;
}
printf("x=%d\n", x);
int i = 4;
int x = 6;
double z;
z = x / i;
printf("z=%.2f\n", z);
What will print when the sample code above is executed?