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
frozen [14]
3 years ago
9

Add the following functions to the code:

Computers and Technology
1 answer:
artcher [175]3 years ago
7 0

Answer:

See explaination

Explanation:

#include <stdio.h>

#include <string.h>

#include <stdlib.h>

void oddsOnly(char* str)

{

int i;

for (i = 0;i < strlen(str);i++)

{

if(i%2 != 0)

{

str[i/2] = str[i];

}

}

str[i/2] = '\0';

}

char* mySubstring(char* string ,int beginIndex,int endIndex)

{

char* new_string = malloc(endIndex- beginIndex);

for (int i = beginIndex ;i < endIndex;i++)

{

new_string[i -beginIndex] = string[i];

}

new_string[endIndex] = '\0';

return new_string;

}

int main(void)

{

char str[] = "hello there";

oddsOnly(str);

char* str1 = mySubstring("smiles",1,5);

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

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

}

You might be interested in
What is workflow? how do you create your own workflow?
lana66690 [7]
A workflow consists of an orchestrated and repeatable pattern of business activity enabled by the systematic organization of resources into processes that transform materials, provide services, or process information.


Create a detailed outline of what you want to achieve and sketch a workflow diagram before using workflow chart software or templates. This will help to ensure your chart is accurate and complete. Always consider your process and workflow manageability when inserting logic in your workflow chart. You can use decision symbols, connectors and text boxes. Always confirm the accuracy of your workflow chart with other stakeholders.


(If you need to know what the workflow diagrams layout is just look it up. GL.)
6 0
3 years ago
Which feature of a blog helps to store and retrieve older posts?
Rashid [163]
Could it be archive posts? I'm not sure, but I believe it's archive posts.
8 0
3 years ago
Read 2 more answers
It is 10PM and you are inside in the middle of a large building. Your cell phone is dead so you cannot use wifi or cell signals
kupik [55]

<em>The answer is: your GPS unit cannot send signals to the satellite when it cannot reach it by line of sight. </em>

<em> </em>

<em>GPS signals are based on frequencies that can be blocked by solid objects (like walls and roofs). A GPS device is using a series of satellites to detect and see where it is physically located. These frequencies are sent from these plates (satellites) and we cannot expect it to go through all kinds of barriers. When you use a GPS inside a building, a wide variety of physical barriers and potential interference sources make it difficult for the device to detect your location accurately. </em>

<em> </em>

<em />

4 0
2 years ago
A class car and its subclass bmw each have a method run(), which was written by the developer as part of the class definition. i
krok68 [10]

The answer is : the run() method defined in BMW will be called.

run() BMW

5 0
3 years ago
Consider the following statements. An abstract class is better than an interface when the variables in the abstract class or int
Ksivusya [100]
Well the nonchalant question given for 4th grade red named babyface Justin and Jerome
4 0
2 years ago
Other questions:
  • It is used to replace numeric number of a website​
    7·1 answer
  • A ____ is a theoretical model of computation that includes a (conceptual) tape extending infinitely in both directions.
    13·1 answer
  • Information from the system that is used to make modifications in the input, processing actions, or outputs is referred to as: G
    9·2 answers
  • If none of the contacts of a manual switch change status when the operator is activated, what is the most probable cause?
    9·1 answer
  • ____ allows you to control how objects enter, move on and exit slides
    13·2 answers
  • Rainfall_mi is a string that contains the average number of inches of rainfall in Michigan for every month (in inches) with ever
    12·1 answer
  • Which of the following best describes the basic purpose of the internet?
    11·1 answer
  • Wearables, video playback and tracking devices can help athletes because
    15·1 answer
  • Something I should look for when trying to decide if a source is credible is the publication's ....
    10·1 answer
  • Write a method in pseudocode or Java called move that accepts a boolean[], integer value, and a boolean value. Your method shoul
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!