08.01.2023 Views

Learn to Program with C_ Learn to Program using the Popular C Programming Language ( PDFDrive )

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 5 ■ Programs with Repetition Logic

24. Write a program to request an integer n from 1 to 9 and print a line of output

consisting of ascending digits from 1 to n followed by descending digits from n-1

to 1. For example, if n = 5, print the line

123454321

25. Solve problem 10, above, assuming that the first line of data contains the number

of rooms (n, say) to carpet. This is followed by n lines of data, one line for each

room.

26. Solve problem 12, above, but this time print the table for exactly 30 days. If

necessary, continue printing the table even if the amount of water falls below

100 liters.

140

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!