Tuesday, 26 March 2013

Reverse of String


By on 10:16

Reverse of String:-


Q)Write a program to enter string(Character Array) and print the reverse of string.

Function used-strrev.This function is used to reverse a string.

Note:-You can also create this program in c++(c plus plus),java,c#(c sharp) languages etc. with the same logic(Functions may be differ).


P:void main()
{
char string[40],reverse[40];
printf("Enter String");
gets(string);
strrev(string);
strcpy(reverse,string);
puts(reverse);
getch();
}

If you have any query then leave your comments and don't forgot to follow me on Google+,Facebook,Twitter.

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...