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]
3 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]3 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
Area on a computer screen where<br> you perform work
raketka [301]

Answer:

Screen or monitor, it may be also the central processing unit (CPU) where you manage your computers actions

brainliest please ;)

3 0
3 years ago
In cell I5, enter a formula to calculate the total admission fees collected for the 2018
V125BC [204]
The formula is to calculate the total admission fees collected is = F5*B14

1. Click on cell I5
2. Type equal sign =
3. Type F5 or click on F5 cell
3. Type multiplication sign *
4. Type B14 or click on B14 cell
4 0
3 years ago
Read 2 more answers
Create a Double complementary or tetradic colors (are a set of two complementary pairs of colors that form a rectangle on the co
hjlf

Answer:

(Remember, two colors are complementary if they are opposite each other ... colors are connected on the color wheel they form a rectangle.

Explanation:

best one i could find if worng am verys very sorry.

4 0
2 years ago
Read 2 more answers
The “Fix a Problem” section of About.com’s PC support page provides information on Reversing Damages and (blank) plss help its t
Lera25 [3.4K]

Answer:

Mistakes

Explanation:

What are the three main technical support options for Microsoft users. Find It Myself, Ask the Community, <u>The "Fix a Problem" section of About.com's PC support page provides information on Reversing Damages and </u><u>MISTAKES.</u>

4 0
3 years ago
Read 2 more answers
Which two protocols manage neighbor discovery processes on ipv4 networks?.
serious [3.7K]

Answer:

Which two protocols manage neighbor discovery processes on IPv4 networks? TCP and UDP BGP and OSPF ICMP and ARP IPv4 and IPv6

Key Links. Pricing.

Subjects. Medical & Nursing.

Company. About Us.

Find Us.

Explanation:

6 0
2 years ago
Other questions:
  • Create a class ProblemSolution with following characteristics Two private member variables name &amp; designation of string type
    8·1 answer
  • The array index can be any nonnegative integer less than the array size.
    10·1 answer
  • Who is the last person appointed to the u.s supreme court
    11·1 answer
  • To a traditional computer, one means
    8·1 answer
  • Write a program in c++ to displaypascal’s triangle?
    14·1 answer
  • A queueing system has four crews with three members each. The number of "servers" is:
    5·2 answers
  • Anyone help pls ? Complete the code below to add css to make the background of the web page orange.
    10·1 answer
  • Write a C# solution for the following problem. Submit your .cs file to this link. Sample output(s) attached. == Create an Employ
    5·1 answer
  • Before her shift as a cashier at the grocery store, Carla pulls her hair back into a ponytail and makes sure her fingernails are
    11·1 answer
  • Why do we install doorbells in our house
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!