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
KIM [24]
3 years ago
11

Using the C language, write a function that accepts two parameters: a string of characters and a single character. The function

shall return a new string where the instances of that character receive their inverse capitalization. Thus, when provided with the character ’e’ and the string "Eevee", the function shall return a new string "EEvEE". Using the function with the string "Eevee" and the character ’E’ shall produce "eevee".
Computers and Technology
1 answer:
Sav [38]3 years ago
8 0

Answer:

#include <stdio.h>

void interchangeCase(char phrase[],char c){

  for(int i=0;phrase[i]!='\0';i++){

      if(phrase[i]==c){

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

              phrase[i]+=32;

          else

              phrase[i]-=32;      

      }

  }

}

int main(){

  char c1[]="Eevee";

  interchangeCase(c1,'e');

  printf("%s\n",c1);

  char c2[]="Eevee";

  interchangeCase(c2,'E');

  printf("%s\n",c2);    

}

Explanation:

  • Create a function called interchangeCase that takes the phrase and c as parameters.
  • Run a for loop that runs until the end of phrase and check whether the selected character is found or not using an if statement.
  • If the character is upper-case alphabet, change it to lower-case alphabet and otherwise do the vice versa.
  • Inside the main function, test the program and display the results.
You might be interested in
Thoughts on copyright?
Nataliya [291]

Answer:

Don't do it. People will sue you even though it was put on the internet.

Explanation:

7 0
2 years ago
Write multiple if statements. if caryear is 1969 or earlier, print "probably has few safety features." if 1970 or higher, print
aliina [53]
If( caryear >= 2000 ):
    print "probably has air bags.\n"
elif( caryear >= 1990 ):
    print "probably has anti-lock brakes.\n"
elif( caryear >= 1970 ):
    print "probably has seat belts.\n"
else:
    print "probably has few safety features.\n"

4 0
3 years ago
Illia is a network administrator at a company.which tasks is she responsible for
irina1246 [14]

Answer: They organize, install, and support an organization's computer systems, including local area networks (LANs), wide area networks (WANs), network segments, intranets, and other data communication systems.

Explanation:

6 0
3 years ago
Consider the packets exchanged in TCP connection setup between Host A and Host B. Assume that Host A's initial sequence number i
Rasek [7]

Answer:

I think that part C correct option

6 0
3 years ago
To lose weight, you must _______.
sweet [91]

Answer:

B

Explanation:

because you need to exercise and eat or drink less calories

8 0
3 years ago
Read 2 more answers
Other questions:
  • Help!!!!!!!!!!!!!!!!!!!
    12·1 answer
  • 12. Noodle Tools is a website that
    8·1 answer
  • The goal expressed in this definition states that data visualization is about ______ . 1. Interpreting 2. Perceiving 3. Facilita
    6·1 answer
  • A(n) _______ gate provides an output of 1 if either or both inputs are 1.
    14·2 answers
  • Which one is the answer for the question.
    11·1 answer
  • Drag the tiles to the correct boxes to complete the pairs.
    13·1 answer
  • Write a multi-way if statement that compares the double variable pH with 7.0 and makes the following assignments to the bool var
    11·1 answer
  • Computer programming 5
    10·1 answer
  • Create a list of 5 potential jobs that students of computer science can obtain.
    9·2 answers
  • Given a list of syntax errors from a compiler, a programmer should focus attention on which error(s), before recompiling?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!