Problem Description
Reverse String using Pointers in CTest Case 1
Input (stdin)Cse
Expected OutputesC
Test Case 2
Input (stdin)Department
Expected OutputtnemtrapeD
Program
#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; }
No comments:
Post a Comment
Note: only a member of this blog may post a comment.