Thursday, March 20, 2008

ORACLE TECHNICAL QUESTIONS

1. What does the following program do ?

int main()
{
int i;
int array1[10], array2[10] ;
int *ep, *ip2 = &array2[0];
int *ip1 = &array1[0];
for(ep = &array1[9]; ep >= ip1; ep–)
*ep = *ip2++ ;
}

(A) copies array1 to array2
(B) copies array2 to array1
(C) copies array1 to array2 in reverse order
(D) copies array2 to array1 in reverse order






2. What does the following program do ?

#include
int main()
{
char string[100];

char *p;

gets(string);
for(p = string; *p != '\0′; p++)
;

printf("%d", p - string);
}

(A) prints the memory used by "string"
(B) prints the character values of "string"
(C) prints the length of "string"
(D) errors out.

No comments: