0% found this document useful (0 votes)
47 views

C++ String Posttest

This document contains a post-test for a learning module on C++ string functions. It lists 10 questions that require the student to write programs using various string functions like strcat, strcpy, reversing a string, converting case, finding string length, comparing strings, and concatenating names. The first question provides an example program that reverses a string as a model for the other questions.

Uploaded by

Kram Pay
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

C++ String Posttest

This document contains a post-test for a learning module on C++ string functions. It lists 10 questions that require the student to write programs using various string functions like strcat, strcpy, reversing a string, converting case, finding string length, comparing strings, and concatenating names. The first question provides an example program that reverses a string as a model for the other questions.

Uploaded by

Kram Pay
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Name: MOZAR ZARVINOM M.

Subject: ES 132

Course & Year: BSCE 2B Date: MAY 10, 2021

LEARNING MODULE NO. 5 – POST-TEST

Instructions: Answer the following questions as directed. Total of 100 points

1. Write a program using string function that reverses the string.

#include <iostream>

#include <string>

using namespace std;

int main ()

string str;

cout<<" Enter the string: ";

cin >> str;

cout<< "Your string is: "<< str << endl;

str = string (str.rbegin(),str.rend());

cout << "The reverse string is: " << str;

return 0;

RESULT:

Enter the string: MOZART

Your string is: MOZART

The reverse string is: TRAZOM

2. Create a program using string functions to convert a character from uppercase


to lowercase.

3. Create a program using string functions to print the inputted string.

4. Create a program to concatenate two strings using strcat function.

5. Create a program to copy one string to another using strcpy function.

6. Create a program using string function to convert a character from lowercase to


uppercase.

7. Create a program using string function that would join strings.

8. Create a program using string function that would display the length of the string.

9. Create a program using string function that would display if the two strings are
equal/similar or not.
10. Create a program using string function that would merge your first name to your family
name

You might also like