Gate2004_33

Consider the following C program segment:

char p [20]
char * s = “string”;
int length = strlen (s);
for (i = 0 ; i < length; i++)
p[i] = s[length – I];
print f(“%”,p);

The output of the program is
(a) gnirts
(b) string
(c) gnirt
(d) no output is printed

Answer

Discuss

0Comment