Question: Design a C program to prompt a user for their first name, last name, their age, and their favorite real number. This program will then

Design a C program to prompt a user for their first name, last name, their age, and their favorite real number. This program will then concatenate the first and last name together into a single string and print the users input back to the console using a single printf() statement. The program should:

A. Prompt the user for their first name and store it into a string. B. Prompt the user for their last name and store itinto a separate string. C. Concatenate the last name onto the string holding the first name. D. Prompt the user for their age (entered asan string) and then convert and store as an integer (int) using the atoi() function.

E. Prompt the user for their favorite real number (entered as an string) and then convert and store as a double using the atof() function.

F. Use a single printf() statement to print the users full name, age, and favorite real number to the console. Your printf() should use three variable formats: %s, %d, and %f.

Note: It is OK that the first and last name are printed on separate lines.

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!