Question: Consider the following C++ program: int main(){ string = Hello; s // (a) // (b) return 0; } a) Write a statement (hint: for

Consider the following C++ program: int main(){ string s=

Consider the following C++ program: int main(){ string = "Hello"; s // (a) // (b) return 0; } a) Write a statement (hint: for loop) that prints the string s in reverse (i.e. will output olleH). b) Write a statement that prints the length of the string s (apply appropriate function).

Step by Step Solution

3.46 Rating (149 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a To print the string s in reverse you can use a f... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!