You must Sign In to post a response.
  • Category: Programming

    How to write the following C program?


    Are you studying C programming course? Finding it difficult to write a string based program? Check out this page for answers from our experts.

    A C program which reads first name and family name of a person, and forms a string containing the full name of the person in the following format:

    The first letter of the first name (in uppercase) followed by a (.), a space and the family name, first letter of which should be in uppercase.

    For example, given the input "Santanu" and "John", it should form a string "S. John" and print the name in the same format.
  • Answers

    1 Answers found.
  • Try the following method by adding format specifiers in a correct way.

    printf("Full Name: %c. %s", firstname[0], &familyname);

    Note: %c is used for single character and %s to print family name.


  • Sign In to post your comments