View Code of Problem 52

#include <stdio.h>
int main(){
  char str[100];
  scanf("%s",str);
  int i=0;
  while(str[i]!='\0'){
  i++;
  }
  int temp;
  for(int j=0,k=i-1;j<=i/2,k>j;j++,k--){
    temp=str[j];
    str[j]=str[k];
    str[k]=temp;
  }
  printf("%s",str);
}

Double click to view unformatted code.


Back to problem 52