Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(3) 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

(3) 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

Seven NoSQL Databases In A Week Get Up And Running With The Fundamentals And Functionalities Of Seven Of The Most Popular NoSQL Databases

Authors: Aaron Ploetz ,Devram Kandhare ,Sudarshan Kadambi ,Xun Wu

1st Edition

1787288862, 978-1787288867

More Books

Students also viewed these Databases questions

Question

=+Identify the type of global assignment for which CCT is needed.

Answered: 1 week ago