Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q3) Write a C program that takes two character arrays of size 15 from the user. The program will take the name and surname of

image text in transcribed
Q3) Write a C program that takes two character arrays of size 15 from the user. The program will take the name and surname of the user using scanf function. Then write a function called "capitalize which receives the strings as pointer arguments. The function will only capitalize the first letter of the name and surname strings. The rest of the characters should be lowercase and if there is an upper-case letter except the first one, it should be converted to lower-case. Also, the function will print the name and surname with one space between each other. Hint 1: Pass the arguments using call-by-reference method and write the function using pointer definition Hint 2: Use the function prototype void capitalize(char *s1, char *s2); Hint 3: Use isupper and islower functions to detect the upper case and lowercase letters. Use toupper and tolower functions to convert lower case letters to uppercase and uppercase letters to lowercase. These functions are defined in ctype.h library Hint 4: If the name of the user is entered as "gEoRGe" and the surname is entered as "BeST", then after applying the capitalize function, the program will print "George Best

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

Databases And Information Systems 1 International Baltic Conference Dbandis 2020 Tallinn Estonia June 19 2020 Proceedings

Authors: Tarmo Robal ,Hele-Mai Haav ,Jaan Penjam ,Raimundas Matulevicius

1st Edition

303057671X, 978-3030576714

More Books

Students also viewed these Databases questions

Question

How would you assess the value of an approach like this?

Answered: 1 week ago

Question

When would you use one approach, and when would you use another?

Answered: 1 week ago

Question

3. How would this philosophy fit in your organization?

Answered: 1 week ago