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]
4 years ago
9

Add the following functions to the code:

Computers and Technology
1 answer:
artcher [175]4 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
Select the best answer for the question. 2. What is the simplest way to permanently get rid of an unwanted file?
Kobotan [32]
To permanetly get rid of an unwanted file, you delete it
3 0
3 years ago
All of the following are incentives proprietary schools use to attract a student except
IRISSAK [1]
Idk what the answer choices are
4 0
4 years ago
Read 2 more answers
HURRY PLEASE ITS A TEST
laiz [17]

<em>A.)</em>

<em>It's either A or D both of them stand out and make sense to me so I think that it'll be right if you choose A or D.</em>

<em>-Ɽ3₮Ɽ0 Ⱬ3Ɽ0</em>

8 0
3 years ago
MMS (in the context of mobile phones) stands for "_______" messaging service.
deff fn [24]

Answer:

Multimedia messaging service

Explanation:

4 0
3 years ago
The next-to-last major stage in the writing process is _____, which involves checking for mistakes in grammar, punctuation, usag
zvonat [6]
The next to last major stage in the writing process is REVISING, which involves checking for mistakes in grammar, punctuation, usage, and spelling
5 0
3 years ago
Other questions:
  • True or false? You can test your marketing emails in different email clients from within the email editor.
    10·1 answer
  • An important advantage of using GUI data-entry objects is that you often can control what users enter by limiting their options?
    6·1 answer
  • __________ is a collection of formatting options—such as a frame, a rounded shape, and a shadow—that changes a picture’s overall
    5·1 answer
  • What answer best explains why improper netiquette is considered dangerous? Individuals who violate user policies are often charg
    14·2 answers
  • Write a program that reads raw data from a file that contains an inventory of items. The items should be sorted by name, and the
    12·1 answer
  • Michael needs to ensure that those items that are automatically archived are still easily accessible within Outlook. Which optio
    7·2 answers
  • How did the use of ARPANET change computing?
    14·1 answer
  • What is the code i need to do
    12·1 answer
  • Which of the following is NOT an example of soft skill?
    10·2 answers
  • Write a loop that continually asks the user what pets the user has until the user enters rock in which case the loop ends. It sh
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!