reverse a string without using string function code example
Example 1: reverse words in a given string
function reverse (word) {
word = word.split('.').reverse().join('.')
return word
}
word = 'i.like.this.program.very.much'
word = 'pqr.mno'
console.log(reverse(word))
Example 2: code to reverse a string
#include
#include
int main()
{
char s[100];
printf("Enter a string to reverse\n");
gets(s);
strrev(s);
printf("Reverse of the string: %s\n", s);
return 0;
}