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
Combination keys perform a function when held down in combination with another key. true or false
Musya8 [376]
The answer to your question is true
3 0
4 years ago
Consider this program: Cost1 = input("Please enter the first expense: ") Cost2 = input("Please enter the second expense: ") prin
Rainbow [258]

it will show '1020'

the inputs dont know that youre putting in numbers. When it adds the inputs together, it just shows them side by side.

4 0
4 years ago
¿Cuál es la diferencia entre una plataforma educativa y una tutoría?
tiny-mole [99]

Answer:

no habla espanola

Explanation:

8 0
3 years ago
What is output unit of a computer system?​
mixas84 [53]

Answer: The third and final component of a computer system is the output unit. After processing of data, it is converted into a format which humans can understand. After conversion, the output units displays this data to users. Examples of output devices include monitors, screens, printers and speakers.

Explanation:

4 0
3 years ago
suspect that several users are attempting to install unauthorized software. Upon researching, you discover that the attempts wer
pochemuha
Two factor authentication? I’m not sure
3 0
3 years ago
Other questions:
  • Acrynom for wys or wyg
    10·1 answer
  • 7.14 LAB: Word frequencies Write a program that reads a list of words. Then, the program outputs those words and their frequenci
    10·1 answer
  • Charts are inserted into an excel spreadsheet using the commands in the charts group on the ____ tab on the ribbon.
    13·1 answer
  • Which group and tab do you need to be in to separate text into two columns? Paragraph group and Insert tab Page Layout group and
    8·1 answer
  • Software project management is the process planning, organizing, and monitoring of the development of a software project from it
    15·1 answer
  • Compute the acceleration of gravity for a given distance from the earth's center, distCenter, assigning the result to accelGravi
    12·1 answer
  • HEPME <br> ZOOM<br> IN <br> STOP<br> GIVIJG<br> ME <br> LINKS <br> !!
    9·1 answer
  • Quiz 6.8 Lesson Practice
    14·2 answers
  • Write a program that reads 20 integers from the user into an array and uses a function arrayMinimum that accepts an integer arra
    5·1 answer
  • Marcus traded in his 10-year-old truck for a new one. Because it is the first new truck he
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!