Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions

Question

Where do you want your school to be at this time next year?

Answered: 1 week ago

Question

What will ongoing support to teachers look like?

Answered: 1 week ago