Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

[Program]: Convert string to reversecase #3820

Closed
20 tasks done
harshraj8843 opened this issue Dec 9, 2022 · 1 comment
Closed
20 tasks done

[Program]: Convert string to reversecase #3820

harshraj8843 opened this issue Dec 9, 2022 · 1 comment
Labels
auto-track Good First Issue Tracker closed closed issues/PRs program

Comments

@harshraj8843
Copy link
Contributor

harshraj8843 commented Dec 9, 2022

Description

Write a program to convert string to reversecase

Reversecase is a style of writing in which all lowercase letters are converted to uppercase and all uppercase letters are converted to lowercase.

Input  : "hello world"
Output : "HELLO WORLD"

Tracking Issues

@harshraj8843 harshraj8843 added the auto-track Good First Issue Tracker label Dec 9, 2022
@harshraj8843 harshraj8843 transferred this issue from codinasion/codinasion May 29, 2023
@harshraj8843 harshraj8843 changed the title Convert string to reversecase [Program]: Convert string to reversecase May 30, 2023
@Sankalps-world
Copy link

#include
#include

std::string reverseCase(const std::string& str) {
std::string result = str;
for (char& c : result) {
if (std::islower(c)) {
c = std::toupper(c);
} else if (std::isupper(c)) {
c = std::tolower(c);
}
}
return result;
}

int main() {
std::string inputString;
std::cout << "Enter a string: ";
std::getline(std::cin, inputString);

std::string reversedCaseString = reverseCase(inputString);

std::cout << "String in reverse case: " << reversedCaseString << std::endl;

return 0;

}

@codinasion-bot codinasion-bot bot added the closed closed issues/PRs label Jun 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-track Good First Issue Tracker closed closed issues/PRs program
Projects
None yet
Development

No branches or pull requests

2 participants