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
A network administrator is implementing a ping from one end of the network to the other, records the average round-trip time and
alexira [117]
May be a Network diagram.
3 0
3 years ago
HELP PLEASEEEE!!!!!!!
Lubov Fominskaja [6]
This is too little points for a question I’m sorry.
8 0
3 years ago
Paris que tipo de sustantivo es?​
pashok25 [27]

Explanation:

CATEGORIA GRAMATICAL PARIS

Paris es sustantivo.

3 0
3 years ago
What is token passing?
Flauer [41]

Answer:

Answer is A network access method that avoids the possibility of data collisions.

Token Ring is the precursor to Ethernet and CSMA/CD to avoid packet collisions.

Explanation:

8 0
4 years ago
In the bussiness cycle which term best fits the labeled point on the graph
andrew11 [14]
In the business cycle, the term that best fits the labeled point on the graph of Production output vs Time is Contraction
8 0
2 years ago
Other questions:
  • Write the execution steps if the input is a lion.
    11·1 answer
  • The ability of services to grow or shrink based on need is called __________.
    14·1 answer
  • 100 points !!! Some games fall under more than one category. For example, many racing games allow players to modify the cars the
    8·2 answers
  • What are some differences between CUI and GUI ?
    7·1 answer
  • A network technician is able to connect the switches between two offices, but the offices cannot communicate with each other, as
    5·1 answer
  • Whitch event describes a festival in rio, brazil that includes a samba parade and eccentric outfits?
    13·1 answer
  • How can you assess a website for currency?
    14·2 answers
  • If you misspell a word in your Java program it may be true that I. the program will not compile II. the program may compile, but
    6·1 answer
  • Hoda needs to create a chart that is associated with an Excel spreadsheet. She needs to ensure that if the data in the spreadshe
    13·1 answer
  • Some scientists say that robots my become self - aware in the near future Do you think this is possible?​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!