Problem Description
Reverse String using Pointers in CCODING ARENA
#include <stdio.h>
#include<string.h>
int main()
{
char str[100];
int i,len;
scanf("%s",str);
len=strlen(str);
for(i=len-1;i>=0;i--)
{
printf("%c",str[i]);
}
return 0;
}
Test Case 1
Input (stdin)Cse
Expected OutputesC
Test Case 2
Input (stdin)Department
Expected OutputtnemtrapeD
No comments:
Post a Comment