Discussion Forums

New User? Please read instructions!

Need C program to reverse given string  

  RSS

thiyagarajan
Eminent Member
Joined: 2 months  ago
Posts: 26
27/01/2017 9:36 am  

Need C program to reverse given string


ReplyQuote
admin
Eminent Member
Joined: 5 years  ago
Posts: 26
31/01/2017 11:44 am  

Hi Thiyagarajan, You can use below C program for reversing a string. If you want to get input string from user, please use scanf and printf in below program.

 

#include<stdio.h>

#include<string.h>

int main()

{

   char name[30] = "Hello";

   printf("String before strrev( ) : %s\n",name);

   printf("String after strrev( )  : %s",strrev(name));

   return 0;

}

Output:

String before strrev( ) : Hello

String after strrev( ) : olleH


ReplyQuote
  
Working

Please Login or Register

Ask your questions or clarify your/others doubts from,

✅ Online Discussion Forums by Fresh2Refresh.com





Share this website !!!
Facebook Twitter Linkedin

Close
We Support JALLIKATTU !!!
We Support JALLIKATTU!
By Fresh2Refresh.com
Show Your Support as well. Thanks!