Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that reads 3 strings then finds out the length of each string and whether the length is odd. Then it should print

image text in transcribed

Write a program that reads 3 strings then finds out the length of each string and whether the length is odd. Then it should print out the strings of odd length. The program should have the following functions: int length(chars[]) calculates and returns the length of the strings. (i.e. how many characters does the string have) int main() declares and reads 3 strings from the user. Then it calls the length function 3 times to find the length of each one of them. Then it should print out only the strings that have an odd length. Note the output screen below: C:\cygwin\bin\sh.exe enter three strings: abc abcd abcdefghi the strings that have odd length are: abc 3 abcdefghi 9 Press [Enter] to close the terminal

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

Database Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions