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
Anastasy [175]
4 years ago
6

Write a function strlen_recursive which accepts a pointer to a string and recursively counts the number of characters in the pro

vided string, excluding the null character. This function should return the number of characters in the string.
Computers and Technology
1 answer:
Over [174]4 years ago
7 0

Answer:

Following are the function

int strlen_recursive(char *str1)  // recursively counts

{

static int l=0; // static variable  

   if(*str1==NULL)  // string is equal to NULL

   {

     return(l);  // returning length

      }

   else

   {

       l++; // increased the length

       strlen_recursive(++str1);  // recursive function

     }

}

Explanation:

Here we are iterating over the loop and check if string is equal to NULL then it return the length of string otherwise it recursively count the length of string.

Following are the code in C language

#include <stdio.h>//heaader file

int strlen_recursive(char *str1) // recursive function

{

 static int l=0;// static variable  

   if(*str1==NULL)  

   {

   return(l); // return length if string is equal to null

      }

   else

   {

       l++;

       strlen_recursive(++str1); // call recursive function

    }

}

int main() // main function

{

   char str1[100]; // declaring array  

   int l=0;

    printf("Enter the string: ");

   gets(str1);// input string

    l=strlen_recursive(str1); // recursive function

printf("Total number of characters are: %d\n",l);

return 0;

}

Output:

Total number of characters are:sa

2

You might be interested in
Can you recover deleted bookmarks on a Chromebook? If so, how?
torisob [31]
I believe not sorry pal :/
4 0
3 years ago
Read 2 more answers
A call center company wants to implement a domain policy primarily for its shift workers. The call center has large groups with
Ulleksa [173]

Answer:

D) Time-of-day restrictions

Explanation:

Based on the goals that the call center company is trying to accomplish it can be said that the best solution would be to implement Time-of-day restrictions. This would mean that only certain groups would be active at specific times during the day, thus allowing the company to focus on each group individually in order to monitor their group performance.

3 0
4 years ago
Which option in PowerPoint allows users to configure the number of columns and rows manually, using numerical values?
babunello [35]

Users can use numerical values to set the number of columns and rows in the Insert Table dialog box in PowerPoint. Option A is correct.

<h3>What is the PowerPoint?</h3>

Microsoft or MS PowerPoint is defined as a presentation program that was developed by Forethought, Inc.'s Robert Gaskins and Dennis Austin. In PowerPoint, users can use numerical values to specify the number of columns and rows in the Insert Table dialog box.

Therefore, option A is correct.

Learn more about the PowerPoint, refer to:

brainly.com/question/14498361

#SPJ1

7 0
2 years ago
.
yan [13]

The correct answer is a paper bag

7 0
4 years ago
19. WHICH KEY ALLOWS YOU TO DELETE AND TYPE OVER TEXTS? *
likoan [24]
The answer is Backspace
4 0
3 years ago
Read 2 more answers
Other questions:
  • Ryan has created a Word document to be used as a review quiz for students in a classroom setting. The document contains both que
    6·1 answer
  • Network Industries, Inc., wants to monitor its employees’ electronic com-munications. To avoid liability under laws related to e
    12·1 answer
  • Do you think that feedly will help you create an effective personal online learning environment? Why or why not?
    15·1 answer
  • To computer the equivalent units of production, add: A. units completed plus a percentage of the beginning WIP units B. units co
    10·1 answer
  • Jeremy is working with a team that is creating an application using attributes and associated methods. What type of programming
    8·1 answer
  • You've run 200 ft of cable and lost 7dB. What is the loss rate of your cable per 100 ft?
    14·1 answer
  • help help help help help help help help help help help help help help help help help help help help help help help​
    7·2 answers
  • What errors does the grammar tool find? Choose all that apply
    11·1 answer
  • A brief contains an initial definition statement of the design aim and defines any constraints?
    11·1 answer
  • What is Smart Content Profits all about?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!