5.23 LAB: Login name (C programming. Answer in C!)
Write a program that creates a login name for a user, given theuser's first name, last name, and a four-digit integer as input.Output the login name, which is made up of the first five lettersof the last name, followed by the first letter of the first name,and then the last two digits of the number (use the % operator). Ifthe last name has less than five letters, then use all letters ofthe last name. Assume the first name and last name have a maximumof 50 characters.
Hint: Make a new string, copy the characters from the first andlast names into the new string, and output the new string as partof the output. Don't forget to add a null character at the end ofthe new string after you have finished copying the characters.
Ex: If the input is:
the output is:
Ex: If the input is:
the output is:
5.23 LAB: Login name (C programming. Answer in C!) Write a program that creates a login name for a user, given the user'
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am