C program: you want me to do what?

  • Thread starter Thread starter Math Is Hard
  • Start date Start date
  • Tags Tags
    Program
AI Thread Summary
The assignment requires writing a printf statement in C that outputs "To be continued" and advances to the next page. The confusion arises from the term "advance to the next page," which some interpret as simply moving to a new line. However, the correct interpretation involves using the escape sequence for a form feed, represented by '\f', which is intended to create a page break. This terminology stems from older printing practices where a form feed command was used to instruct printers to move to the next sheet of paper. Other escape sequences like '\n' (new line), '\r' (carriage return), and '\v' (vertical tab) were also discussed, but '\f' is specifically meant for advancing to the next page.
Math Is Hard
Staff Emeritus
Science Advisor
Gold Member
Messages
4,650
Reaction score
39
Hi all,

I am working on one of my first assignments for my C class. My teacher gave the following instructions:

Write a printf statement that outputs the phrase "To be continued" and then advances to the next page.

I am completely confused by what he means by "advance to the next page"? Is that like going to a new line? I thought I would ask y'all first before I email him in case it's something completely obvious.

thanks!
 
Computer science news on Phys.org
Math Is Hard said:
Hi all,

I am working on one of my first assignments for my C class. My teacher gave the following instructions:

Write a printf statement that outputs the phrase "To be continued" and then advances to the next page.

I am completely confused by what he means by "advance to the next page"? Is that like going to a new line? I thought I would ask y'all first before I email him in case it's something completely obvious.

thanks!
Looks like he wants a page break. You probably know that '\n' is the new line character, and will advance to the next line. See if you can find a bunch of special characters, and find the one that advances to the next line.
 
Hrm... maybe he meant "advances to the next line"?
 
Next line is all I can figure - and I can't find anything about "next page" anywhere in my book. However, there's plenty of instruction in the first chapters about going to the next line.
Thanks for your help.
 
\f - form feed
\r - carriage return
\v - vertical tab

If you look in the index of your book, you should find these. Or look up "escape sequences." Anyways, the 3 above are the ones I would think most likely to produce a new page... experiment and let us know what does what.
 
Who knows,

He may want you to wait for an input after the "to be continued", and then clear the page by having enough \n's.
 
I agreed completely !
3 months later, new school year begins in schools in America. Are you making some preparations for it ?

______________________________________________

My signature:
>>>> Some places i have learned are full of injuries, tears, and blood, if that is what people call a little actual love for their lovers, they should never try to bring their lovers to such places <<<<

Please don't quote this post of mine because my signature will go with your quote...<SAL>(smile a lot)
 
aha! here's what my prof sez:

This is a case of "old" terminology corrupting the modern generation. In my day, printers used continuous feed paper where you had to separate each sheet along the perforation. To tell the printer to go to the next sheet, or "form", you did a form feed command to the printer. The terminology is still used on occation today to mean "next page". The printf escape sequence is \f for "Form feed" which really means "page break" or "advance to next page".
 

Similar threads

Back
Top