Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
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.
C++
Memory_test
Policy based smart pointer
Kth smallest element
Test 2(2021)
Cours C++
Policy based smart pointer
Guess Number
Teste sobrecarga de operadores
Compare boost optional with the actual value
Please log in to post a comment.