Question: c programming (3) Write a C program that takes two-character arrays of size 15 from the user. The program will take the name and surname

 c programming (3) Write a C program that takes two-character arrays

c programming

(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 *sl, 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!