Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in c Create a program that reads two strings of length 5 from the user. The user must enter a 5 letter word for both

image text in transcribed
in c
Create a program that reads two strings of length 5 from the user. The user must enter a 5 letter word for both or your program should warn them and exit. Assuming the user enters valid input, your program will compare the two strings based on the following conditions: 1.If the character is the same in both strings, print a . 2. If the character is present in the first string, but not in the matching position in the second string, print a 3. If the character in the first string is not present in the second string, print nothing. Your program should include a function which accepts the following parameters: - char[l] - The string to compare against (this will be the second string as input earlier). - char - The character to compare. - int - The position of the character in the first string. The function should return a char dependent on the conditions above. Requirements - (5 points) Create a function that accepts the parameters listed above. - (2.5 points) Read in two strings of length 5 from the user using fgets. - (2.5 points) Remove the newiline character captured by the input. - (10 points) Compare the two strings and print the output as described above

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_2

Step: 3

blur-text-image_3

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

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions

Question

Draw a schematic diagram of I.C. engines and name the parts.

Answered: 1 week ago