View Code of Problem 52

#include<stdio.h>

int main() {
	char str[100];
	int i, len;
	gets(str);
	for(i=0;;i++) {
		if(str[i] == '\0') {
			len = i;
			break;
		}
	}
	char a[len];
	int j = 0;
	for(i=len-1; i>=0; i--) {
		if(j != len){
			a[j] = str[i];
			j++;
		}
		else 
			break;
	}
	printf("%s", a);
	return 0;
}

Double click to view unformatted code.


Back to problem 52