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
Is there such thing as free will
dybincka [34]

Answer:

Yes there is but it's rare cause everywhere we go we're tied down from some rules cause they help society function better

7 0
3 years ago
Read 2 more answers
Which of the following would a high school graduate interested in the performing arts most likely do after graduation?
pashok25 [27]

Answer: College

Explanation: I got it right on my quiz

3 0
3 years ago
Write down a program in SNOBOL thatcalculates the factorial of 7.
Sati [7]

Answer:

         n = f = 7

loop  f = gt(n,1) f * (n = n - 1) :s(loop)

         output =  f

end

Explanation:

3 0
3 years ago
________ is a process where authentication and permission will be passed on from one system to another, usually across multiple
hoa [83]

Answer: Federation

Explanation:

In multiple enterprises there are number of authentication processes to access resources and information so in order to avoid a large number of authentications we have a process called federation whereby all the authentication and authorization processes are passes from one system to the other within the enterprise.

3 0
3 years ago
Why do some people argue that tech companies like Apple should do more to address the smartphone addiction problem?
Neko [114]

Answer:

Cause It Will Help Make A Fix For The Issue

Explanation:

Does This Help?

5 0
3 years ago
Other questions:
  • Attention merchants define
    5·1 answer
  • Viet drives around and checks meters to document the amount of electricity used in homes. What Energy pathway is he a part of? E
    9·2 answers
  • The operations planning practice of inputting sales forecasts into computer software that accurately predicts the amount and tim
    6·1 answer
  • Organisms are classified as producers or consumers acorrding to the way they
    11·2 answers
  • Disk quotas are set using the ____ console. diskpart disk management mst windows explorer
    10·1 answer
  • A network that typically reaches a few meters, such as up to 10 meters (33 feet), and consists of personal devices such as mobil
    14·1 answer
  • Edhesive coding practice 3.4​
    13·2 answers
  • What term is used to refer to the merging of government services with information technology?
    11·1 answer
  • Correct all the mistakes in the following sentence:
    15·2 answers
  • Smart art can be used to create that highlight relationships between two items
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!