View Code of Problem 52

#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[])
{
	char str[100],t;
	int i=0,p=0,q=0;
	gets(str);
	while(str[q]!='\0')
	{
		q++;
	}
	while(p<q)
	{
		t=str[p];
		str[p]=str[q-1];
		str[q-1]=t;
		q--;p++;
	}
	printf("%s",str);
	return 0;
}

Double click to view unformatted code.


Back to problem 52