Question: C PROGRAM NEED SAME OUTPUT DONOT GIVE WRONG OUTPUT 1 - WAP to implement getword function Description: int getword(char *word) Create a function named getword.

C PROGRAM NEED SAME OUTPUT DONOT GIVE WRONG OUTPUT

1 - WAP to implement getword function

Description:

int getword(char *word)

Create a function named getword.

Function will receive the string from main

Function should return the length of the first word.

Pr-requisites:-

Functions

Pointers

Objective: -

To understand the concept of

Functions and Pointers

Inputs: - String Sample execution: - Test Case 1: Enter the string : Welcome to Emertxe You entered Welcome and the length is 7 Test Case 2: Enter the string : Hello

You entered Hello and the length is 5

REQUESTED FILE

#include

int getword(char str[]);

int main() { int len = 0; char str[100];

printf("Enter the string : "); scanf(" %[^ ]", str);

len = getword(str);

printf("You entered %s and the length is %d ", str, len); }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!