Homework 11: fprintf
Name: _____________________________________________ Alpha: ___________________
Describe help received: ________________________________________________________
- Due before class on Monday, February 6
- This homework contains code to be submitted electronically.
Put your code in a folder called
hw11
and submit using the204sub
command. - This is an electronic homework and you do not need to print out anything to turn in during class.
Assignment
- Required reading: Sections 1 (Streams) and 2 (Format strings and fprintf) from the Unit 4 notes,
-
Write a program called
timestwo.c
that reads an integer \(n\) from the user and prints out that number times two as follows:roche@ubuntu$
./timestwo
Enter n:
14
2 * 14 = 28.
You must use a `fprintf` statement to produce the output line! Don't forget to put a period `.` and a newline at the end of the last line.
- Spend time making some real progress on the project.