Write a program that prompts the user to input a string and display the string from backward.
#include <stdio.h>
int main()
{
char str[80];
int l, i;
printf("Enter a string: ");
gets(str);
/* Find the length of the string */
for (l = 0; str[l] != '\0'; l++);
/* Display the string backwards */
for (i = l - 1; i >= 0; i--)
{
printf("%c", str[i]);
}
return 0;
}
Enter a string: computer science
ecneics retupmoc