Multiprogramming Language Trainer
Thursday, 10 November 2016
C Program to reverse a String
#include<stdio.h>
#include<conio.h>
void
main(){
char
str[20];
clrscr();
printf(
"Enter string: "
);
gets(str);
//reads string from console
printf(
"String is: %s"
,str);
printf(
"\nReverse String is: %s"
,strrev(str));
getch();
}
Output:
Enter string: welcome String is: welcome Reverse String emoclew
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment