Programming Exercises
Write a program that asks for your first name and then your last name, and then prints the names in the format last, first.
Write a program that requests your first name and does the following with it:
Prints it enclosed in double quotation marks.
Prints it in a field 20 characters wide, with the whole field in quotes.
Prints it at the left end of a field 20 characters wide, with the whole field enclosed in quotes.
Prints it in a field three characters wider than the name.
Write a program that reads in a floating-point number and prints it first in decimal-point notation and then in exponential notation. Have the output use the following formats:
The input is 21.3 or 2.1e+001.
The input is +21.290 or 2.129E+001.
Write ...
Get C Primer Plus®, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.