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
____________ is/are the information, knowledge of people or things, and connections that help individuals enter preexisting netw
Harlamova29_29 [7]
The social capital is the answer
6 0
3 years ago
What is the point of having bullets points in a text box
Ludmilka [50]
You should have bullets in a text box in case you have a list of stuff. For example:

Computer Parts

.Tower

.Monitor

. Mouse

.Printer


3 0
4 years ago
A = 250; B = 325. which of the following statements is true? A ==B A&gt;B A =B
Ivanshal [37]

Answer:

lollol

Explanation:

7 0
3 years ago
Should people who download music and movies illegally be punished?
Mrrafil [7]
Opinion wise, I disagree with punishment. 
3 0
3 years ago
A digital camera is an_____​
garik1379 [7]

ITS ABOUT DRIVE

ITS ABOUT POWER

WE STAY HUNGRY

WE DEVOUR

PUT IN THE WORK

PUT IN THE HOURS ⌚

AND TAKE WHATS OURS

Explanation:

fr what is it?

7 0
3 years ago
Read 2 more answers
Other questions:
  • Why are digital calendars considered to be a convenient way to maintain a study schedule?
    10·2 answers
  • If parties in a contract are not _______, the contract can be canceled.
    7·1 answer
  • Explain briefly why people often have a pretty good understanding of computer hardware.
    14·1 answer
  • Honestly reporting experimental findings is an example of good what?
    7·2 answers
  • Whats the difference between firms that provide services and firms that sell products?
    7·2 answers
  • Assuming x and y are variables of type float, the expression:
    6·1 answer
  • Which software documentation guideline did the IEEE establish?
    10·1 answer
  • You are asked to write a program that prompts the user for the size of two integer arrays, user input for the size must not exce
    13·1 answer
  • What will the following program display in the console?
    13·2 answers
  • What type of light comes from reflections off other objects?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!