67 279
Assignments Done
99,1%
Successfully Done
In November 2018

Answer to Question #25039 in C++ for hanrik

Question #25039
Write a C++ program that accepts a string and deletes the last character by moving the null character one position the left.
Expert's answer
#include<iostream>
#include <string>

using namespace std;

int main() {
string s;
cin >> s;
for (int i=s.size(); i>0; i--)
s[i]=s[i-1];
cout << s;
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions