DS3_5

#include <iostream.h> #include <conio.h> #include <string.h> void reverse(char[]); int main() { char string[10]="Hello"; int choice; clrscr(); reverse(string); getch(); return 0; } void reverse(char s[]) { int len=strlen(s); char text[10]; int a=0; for(a=0;len>0;len--,a++) text[a]=s[len-1]; text[a]='\0'; cout<<"\nReversed string = "<<text; }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.