Reversing using Inbulit func
#include <stdio.h>
#include <string.h>
// initialization same as arrays
// strrev(name_of_string)
int main(){
char str[] = "123456"; //[] shows the length of input string
printf("The before string was =%s\n",str);
printf("The after string is =%s\n",strrev(str));
char str2[] = "coding is fun"; //[] shows the length of input string
printf("The before string was =%s\n",str2);
printf("The after string is =%s\n",strrev(str2));
return 0;
}
//Programmer: TEJAS
Output
Comments
Post a Comment