Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Reverse a String
#include<iostream> #include<string.h> using namespace std; int main() { char input[50]; char temp; int length; cout << "Enter any string" << endl; cin >> input; length=strlen(input); cout<<"The Reversed String is" << endl; for(int i=0, j=length-1; i<length/2; ++i,--j) { temp=input[i]; input[i]=input[j]; input[j]=temp; } cout<<input; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Good1
stlsizeof.cc
11340 v3.1
use of assert to check a particular situation! (throws error)
Building squares using smallest amount of matches
Graph DFS
Запаковать строку в JSON (Boost)
Sample Code from Scott Meyer's Blog
matrix2
Heap DS and Heapsort
stackse - search stackoverflow differently
Please log in to post a comment.