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
What is the main purpose of a DNS server?
Daniel [21]

Answer:

C

Explanation:

Domain Name Servers (DNS) are the Internet's equivalent of a phone book. They maintain a directory of domain names and translate them to Internet Protocol (IP) addresses.

3 0
3 years ago
Which of the following examples illustrates the Crowding Out Effect?
maks197457 [2]

your answer is c to what your looking for



6 0
3 years ago
• Why does a lunar eclipse last longer than a solar eclipse?
Wittaler [7]
The shadow cast by the earth is quite a bit larger than the moon
5 0
4 years ago
How many bytes are in 1 kilobyte of storage
topjm [15]

Answer:

1000

Explanation I SEARCHED IT Up

5 0
4 years ago
Which security measure provides protection from IP spoofing?
anyanavicka [17]

Answer:

An SSL also provides protection from IP spoofing.

8 0
3 years ago
Other questions:
  • QUESTION 1 _____ is a type of data encryption that enables users of the Internet to securely and privately exchange data through
    14·1 answer
  • Choose the word pair that would best complete this analogy <br> annihilation : obliteration
    7·1 answer
  • Key differences between software and books include all of the following except
    15·2 answers
  • Which of the following statements about functional programming languages is incorrect?A) In pure functional programming, there a
    5·1 answer
  • Words or symbols that help you narrow down your search are called:
    12·1 answer
  • What does perseverance mean?
    11·2 answers
  • Define the term algorithm and describe how programmers use algorithms when designing a program.
    6·1 answer
  • ANSWER ASAP! 50 POINTS!!!!
    10·2 answers
  • Describe four features of a well designed input screen
    10·2 answers
  • Area Triangolo Rettangolo in c++
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!