Question: / * This program reads user input from the console and uses it to display formatted output. * / #include #define STR _ LENGTH 5
This program reads user input from the console
and uses it to display formatted output.
#include
#define STRLENGTH
int mainvoid
Char arrays to store the input
char firstnameSTRLENGTH;
char lastnameSTRLENGTH;
int age;
Prompt user input.
printfEnter the customer's first name: ;
scanfs firstname;
printfEnter the customer's last name: ;
scanfs lastname;
printfEnter the customer's age: ;
scanfd &age;
Produce the output
printf
The customer is named: s s
firstname, lastname;
printfThey are d years old.
age;
printfGood bye!";
A newline char at the end of the output.
putchar
;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
