Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students also viewed these Databases questions

Question

How can data visualisation aid in networking analysis?

Answered: 1 week ago