Write an Algorithm to reverse a string without using any built-in function.
#include <stdio.h>
int main() {
char str[100], temp;
int i, j = -1;
// Take string input from user.
printf("Enter string");
gets(str);
i = 0;
// count the length of a input string.
while(str[++j]!='\0');
j = j - 1;
/* Swap the positions of an element. */
while (i < j) {
temp = str[i];
str[i] = str[j];
str[j] = temp;
i++;
j--;
}
printf("Reverse of a input string is :%s", str);
return (0);
}