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]
2 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]2 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
I need to create a method named "root positive". which will either print the square root of the number passed to it or if the nu
rjkz [21]

Answer:

Explanation:

The following code is written in Java. It is a method that calculates the square root of a number as requested. The method first checks with an IF statement if the parameter value is a positive number and then calculates the square root and prints it to the screen. Otherwise, it prints Number must not be negative. A test case has been provided in the main method and the output can be seen in the attached image below.

import java.util.Scanner;

class Brainly {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.print("Enter a number of type double to calculate square root:");

       double num = in.nextDouble();

       rootPositive(num);

   }

   public static void rootPositive(double num) {

       if (num > 0) {

           System.out.println(Math.sqrt(num));

       } else {

           System.out.println("Number must not be negative.");

       }

   }

}

5 0
3 years ago
This is not a factor that you should use to determine the content of your presentation. Your audience your goals your purpose yo
aksik [14]

Your technology I believe

4 0
3 years ago
Read 2 more answers
Assume values 10, 20, 30, and 40 are entered in the cell range A1:A4. Cell A10 contains the formula: =A1+A2+A3+A4 and displays v
r-ruslan [8.4K]

Answer:

The formula and value to this question is "=A1+A3+A4+A5 with value 100"

Explanation:

The explanation of the given question as follows:

  • In question, it is defined that four cells that are "A1, A2, A3, and A4"  contains value that are "10, 20, 30, and 40".
  • To add these values we use addition formula that is "=A1+A2+A3+A4". it will give value 100.
  • If the user inserts a new row that is "A2" and assigns a value in the cell that is "50" so, we use the above formula that adds values with these values we also use the value "100".
8 0
2 years ago
An algorithm requires numbers.<br> O True<br> O<br> False
Naya [18.7K]
True hope this helps
6 0
2 years ago
Read 2 more answers
The variable 'a' starts with the value 1 The variable 'b' starts with the value 10 The variable 'c' starts with the value 100 Th
Anettt [7]

Answer:

The answer is B = 365

Explanation:

The following variable were initialized:

a = 1

b = 10

c = 100

x = 0

Then we store the value of 'c' times 3 in 'x'

x = 3 * c = 3 * 100 = 300

x = 300

Then we add the value of 'b' times 6 to the value already in 'x'

x = x + 'b' times 6

x = x + (b * 6) = 300 + (10 * 6) = 300 + 60 = 360

x = 360

Then we add the value of 'a' times 5 to the value already in 'x'

x = x + 'a' times 5

x = x + (a * 5) = 360 + (1 * 5) = 360 + 5 = 365

x = 365.

Therefore, the value of 'x' displayed is 365.

4 0
3 years ago
Other questions:
  • How does microchip work
    12·1 answer
  • The two ways to use the help menu is by searching of the contents or searching the _____
    13·2 answers
  • Kuta software infinite pre- algebra multiplying polynomial and a monomial find product answer key
    14·1 answer
  • As a member of the accounting group,
    10·1 answer
  • What is netbeans and what is it for??
    9·1 answer
  • What are the benefits and risks of a client-server network?
    5·1 answer
  • Your program will be used by many departments at the university. Your comments will be important to their IT people. What would
    13·1 answer
  • Discuss how a lack of infrastructure in poor communities could contribute to ill-health such as the Unrest looting.​
    9·1 answer
  • What is the second row of letters in the keyboard called?
    6·1 answer
  • a value-returning method must specify as its return type in the method header. question 18 options: a) an int b) a double c) a b
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!