C program: you want me to do what?

  • Thread starter Thread starter Math Is Hard
  • Start date Start date
  • Tags Tags
    Program
Click For Summary

Discussion Overview

The discussion revolves around interpreting a programming assignment in C, specifically regarding the instruction to write a printf statement that outputs "To be continued" and advances to the next page. Participants explore the meaning of "advancing to the next page" in the context of C programming and its associated escape sequences.

Discussion Character

  • Homework-related
  • Debate/contested
  • Exploratory

Main Points Raised

  • One participant expresses confusion about the term "advance to the next page," questioning if it means going to a new line.
  • Another participant suggests that the teacher likely wants a page break, mentioning that '\n' is the new line character.
  • A different participant proposes that "advances to the next line" might be the intended meaning.
  • One participant notes the lack of information about "next page" in their textbook, indicating a focus on new line instructions instead.
  • Another participant lists escape sequences such as '\f' (form feed), '\r' (carriage return), and '\v' (vertical tab) as potential solutions for producing a new page.
  • One participant speculates that the teacher might want an input prompt after the output, followed by multiple new lines to clear the page.
  • A later reply provides historical context, explaining that "form feed" was terminology used in older printing practices, linking it to the escape sequence '\f' for page breaks.

Areas of Agreement / Disagreement

Participants generally agree that the term "next page" is ambiguous and likely refers to a page break, but there is no consensus on the exact interpretation or implementation of the assignment. Multiple competing views remain regarding the appropriate escape sequences and their meanings.

Contextual Notes

Participants reference various escape sequences and their functions, but there is uncertainty about their application in the context of the assignment. The discussion reflects differing interpretations of terminology and the potential for outdated language to cause confusion.

Math Is Hard
Staff Emeritus
Science Advisor
Gold Member
Messages
4,663
Reaction score
36
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

Replies
42
Views
5K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 1 ·
Replies
1
Views
11K
  • · Replies 28 ·
Replies
28
Views
3K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 17 ·
Replies
17
Views
4K