C
int main() {
char p[]= "geeksquiz" ;
char t;
int i,j;
for (i=0,j= strlen (p);i!=j;i++,j--)
{
t=p[i];
p[i]=p[j-i];
p[j-i]=t;
}
printf ( "%s" ,p);
return 0;
}
|
Output?
(A)
ziuqskeeg
(B)
Nothing is printed on the screen
(C)
geeksquiz
(D)
gggggggg
Answer: (B)
Explanation:
The string termination character \’\\0\’ is assigned to first element of array p[]
Quiz of this Question
Please comment below if you find anything wrong in the above post
Last Updated :
28 Jun, 2021
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...