C program: you want me to do what?

  • Thread starter Math Is Hard
  • Start date
  • Tags
    Program
In summary, my teacher is saying that to tell the printer to go to the next page, you would use a form feed command.
  • #1
Math Is Hard
Staff Emeritus
Science Advisor
Gold Member
4,652
38
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
  • #2
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.
 
  • #3
Hrm... maybe he meant "advances to the next line"?
 
  • #4
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.
 
  • #5
\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.
 
  • #6
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.
 
  • #7
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)
 
  • #8
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".
 

FAQ: C program: you want me to do what?

What is a C program?

A C program is a computer program written in the C programming language. It is a high-level programming language used to develop software and applications for a wide range of platforms.

Why should I learn C?

C is a widely used and versatile programming language that is still relevant in many industries today. It is the basis for many modern programming languages and can be used for a variety of applications, from operating systems to mobile apps.

Is C difficult to learn?

Like any programming language, C has a learning curve, but it is not considered to be extremely difficult. It has a simple syntax and a relatively small set of keywords, making it easier to understand compared to other programming languages.

What can I do with C?

C is a general-purpose programming language, which means it can be used for a wide range of purposes. Some common applications of C include operating systems, language compilers, device drivers, and gaming engines.

Can I use C to create web applications?

C is not typically used for web development, as it does not have built-in features for handling web-related tasks. However, it can be used in conjunction with other languages, such as CGI or PHP, to create web applications.

Similar threads

Replies
2
Views
2K
Replies
12
Views
2K
Replies
1
Views
10K
Replies
9
Views
2K
Replies
2
Views
2K
Back
Top