Monday, September 17, 2012

Code#72:C Program To Reverse a String

| |
Basic C Language Program  To Reverse a String is explained below with a detailed explanation,you will find it easy to go through this program, Sample input and output screen shots has been provide for the better understand ability to the user, leave a comment if you are satisfied with the code
                                            Click Read more to see the code



#include<stdio.h>
#include<string.h>

main()
{
   char arr[100];

   printf("Enter a string to reverse\n");
   gets(arr);

   strrev(arr);

   printf("Reverse of entered string is \n%s\n",arr);

   return 0;
}
Output:
Enter a string to reverse
hello
Reverse of entered string is 
olleh

0 comments:

Post a Comment

Powered by Blogger.