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
Sonbull [250]
2 years ago
14

[c++] Write a recursive function takes a word string as input argument and reverse the word. Print out the results of recursive

calls. Also write a main program accepts input from the user and then call the recursive function.
Example:
Enter a word: hello
h
eh
leh
lleh
olleh ...?
Computers and Technology
1 answer:
Aleks04 [339]2 years ago
3 0
I will try to give you the best answer I can possibly come up with. 
The easy way to get it is to store it into an array of strings and print the array of string backwards. You can do that by starting at the last part of the array down to the first letter.
You might be interested in
Write a c program that reprints input so that no line is longer than 50 characters. Specifically, for lines less than or equal t
Alex73 [517]

Using the knowledge in computational language in C++ it is possible to write a code that reprints prints input so that no line is longer than 50 characters.

<h3>Writting the code:</h3>

<em>#include<stdio.h></em>

<em />

<em>int main(int argc, char** argv){</em>

<em>    //creating pointer to read a file</em>

<em>    FILE * fp;</em>

<em>    char * line = NULL;</em>

<em>    size_t len = 0;</em>

<em>    ssize_t read;</em>

<em>    int i=0;</em>

<em>    //opening a file</em>

<em>    fp = fopen(argv[1], "r");</em>

<em>    //handling the error condition</em>

<em>    if (fp == NULL){</em>

<em>        printf("File not found..!!");</em>

<em>        return 0;</em>

<em>    }</em>

<em>    int moreThan50 =0;</em>

<em>    //reading a file line by line</em>

<em>    while ((read = getline(&line, &len, fp)) != -1) {</em>

<em>        i = 0;</em>

<em>        if(read >= 50){</em>

<em>            moreThan50++;</em>

<em>        }</em>

<em>        while(i < read){</em>

<em>            if(line[i]!='\n'){</em>

<em>                if(i%50 == 0){</em>

<em>                    printf("\n%c",line[i]);</em>

<em>                }else{</em>

<em>                    printf("%c",line[i]);</em>

<em>                }</em>

<em>            }</em>

<em>            i++;</em>

<em>        }</em>

<em>    }</em>

<em>    printf("\nTotal lines over 50 chars: %d\n",moreThan50);</em>

<em>    printf("Offending Lines: ");</em>

<em>    for(i=1;i<=moreThan50;i++)</em>

<em>        printf("%d, ",i);</em>

<em>    fclose(fp);</em>

<em>    return 0;</em>

<em>}</em>

See more about C++ at brainly.com/question/19705654

#SPJ1

4 0
1 year ago
Who played a leading role in perfecting movable type for printing?
vaieri [72.5K]
Johannes Gutenberg, although there are various examples of movable type from China (and Korea, to a lesser extent).
6 0
3 years ago
The automotive system that connects the engine and the transmission to the wheels is called the
insens350 [35]
I believe the driveshaft 

8 0
2 years ago
In a paragraph discuss 5 steps of saving a document in a storage device.<br>​
zubka84 [21]
<h2>The five steps of saving a document in a storage device are firstly, click File. Secondly, click Save As.</h2><h2> In addition, click Computer. Moreover, double click the storage device and type file name. Lastly, click Save or Enter.</h2>
6 0
2 years ago
Irene establishes a wireless connection between her laptop and smartphone for sharing files. She has created a LANWANPAN, which
stira [4]

Irene created a LAN , which generally uses Ethernet cables for communication.

<h3>What is LAN about?</h3>

The LAN ports are known to be employed to link computers that do not have Wi-Fi access and it is one that make use of an Ethernet cable.

Note that Irene created a LAN , which generally uses Ethernet cables for communication to access the internet.

Learn more about  wireless connection from

brainly.com/question/26956118

#SPJ1

3 0
2 years ago
Other questions:
  • Landon starts his computer and receives the error message, "Hard drive is not found." In a panic, he calls you because he did no
    14·2 answers
  • Attacker player X is standing still on a corner kick, as the ball is played, he jumps up with his arms flailing above his should
    8·1 answer
  • How would this requirement be implemented?
    12·1 answer
  • How do you change a account on an iPod generation 5
    10·1 answer
  • This assignment requires you to write a program to analyze a web page HTML file. Your program will read one character at a time
    13·1 answer
  • Write a method, findMax(), that takes in two integers and returns the largest value. Ex: If the program input is: 4 2 the method
    8·1 answer
  • What is functionality criteria or alternative word
    8·1 answer
  • PLZZZZZZZZZZ HELP ME OUT THIS DUE TODAY AND NEED SOMEONE HELP!!!!!plzzzzzzzzzzz i begging you!!!
    11·1 answer
  • Phishing (pronounced fishing) is malware sent through e-mail that looks like a legitimate message from a trusted sender. The goa
    10·2 answers
  • It refers to the story or events in which the film revolves.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!