1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
qwelly [4]
2 years ago
12

Given a string, convert the characters of the string into opposite case,i.e. if a character is lower case than convert it into u

pper case and vice versa.
Examples:

Input : geeksForgEeks
Output : GEEKSfORGeEKS

Input : hello every one
Output : HELLO EVERY ONE
Recommended: Please try your approach on {IDE} first, before moving on to the solution.
ASCII values of alphabets: A – Z = 65 to 90, a – z = 97 to 122
Steps:

Take one string of any length and calculate its length.
Scan string character by character and keep checking the index .
If character in a index is in lower case, then subtract 32 to convert it in upper case, else add 32 to convert it in upper case
Print the final string.
Computers and Technology
1 answer:
o-na [289]2 years ago
8 0

Answer:

// CPP program to Convert characters  

// of a string to opposite case  

#include<iostream>  

using namespace std;  

// Function to convert characters  

// of a string to opposite case  

void convertOpposite(string &str)  

{  

int ln = str.length();  

 

// Conversion according to ASCII values  

for (int i=0; i<ln; i++)  

{  

 if (str[i]>='a' && str[i]<='z')  

 //Convert lowercase to uppercase  

  str[i] = str[i] - 32;  

 else if(str[i]>='A' && str[i]<='Z')  

 //Convert uppercase to lowercase  

  str[i] = str[i] + 32;  

}  

}  

// Driver function  

int main()  

{  

string str = "GeEkSfOrGeEkS";  

 

// Calling the Function  

convertOpposite(str);  

 

cout << str;  

return 0;  

}  

Explanation:

You might be interested in
Hey guys, I am new here but I keep getting questions that are too hard for me and I already set my grade level, what else can I
zysi [14]

Answer:

I don't know, Brainly says im an expert but i dont think so

4 0
3 years ago
5) How is the operating system on a desk top computer different from the operating system on a smart phone?​
lesya692 [45]
The difference is that system on a desk top preforms all the basic tasks like file management, memory management handling input and output and controlling peripheral devices such ad disk and printers where as some smart phone work on specific hardware
6 0
3 years ago
The leader in student travel who provides educational tours at affordable prices is called?
jenyasd209 [6]

Answer:

Juniour tours

Explanation

Juniour tours provide exceptional travel experience for their students in the educational travel market. They normally have customized packages that are usually customized and very affordable for the students. It offers tour escorts, food and accomodations, and round trip transportation.

3 0
2 years ago
n publishing terms, the word tone refers to a A. color's brightness. B. color's PMS number. C. primary color. D. original pigmen
IrinaK [193]
Referred to a color's brightness.

Tone in publishing refers to the shading of light and dark on an object. When we discuss the element of tone, we discuss light and dark. Color’s brightness on the other hand is the relative lightness or darkness of a certain color. Brightness is normally influenced by a color’s lightness and thus, tone is the color’s brightness.



3 0
3 years ago
Read 2 more answers
Where is the Appearance and Personalization option found?
Anna71 [15]

Answer:

A.in the troubleshooting section

Explanation:

Appearance and personalization is a category or set of tools which is found in the control panel in the start menu of windows.

Appearance and personalization allow the user to use various tools like customization of windows, change the theme, screen savers, file explorer options, navigation buttons, ease of access centre, change fonts etc.

The appearance and personalization category is present as the sixth panel of the control panel. The troubleshooting section allows the user to open the control panel from which appearance and personalization category can be opened.

Thus, Option-A is the correct answer.

8 0
2 years ago
Other questions:
  • Which sparkline type is best for displaying trends in data changes over time?
    11·1 answer
  • Elisa and josh need to access general helps. Elisa will press the F1 key. josh will on ?. who will access general help
    15·1 answer
  • What does DKIM stand for?
    9·2 answers
  • A list of pages within a Web site that you have visited and that usually appears at the top of a page is referred to as a(n) ___
    14·1 answer
  • The interaction between information technology and organizations is influenced___________.A) solely by the decision making of mi
    12·1 answer
  • Write an SQL statement to list the Name of employees who have worked on a property in New York .
    7·1 answer
  • Which of the following is NOT an example of soft skill?
    8·1 answer
  • 1. Write an if statement that assigns 20 to the variable y, and assigns 40 to the variable z
    10·1 answer
  • How do you copy a file​
    9·1 answer
  • Which of the following is an operating system?<br> MacBook Air<br> Windows 10<br> Dell
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!