answersLogoWhite

0


Best Answer

In code, you'd actually do something like so: '\n'.

Actually, the ASCII code of the Line Feed is 10 (0A hex), and the code of the Carriage Return is 13 (0D hex).

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

New Line in C Programming in \n. Just put it as is.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

I guess you mean this:

puts ("Hello\nNext line\nThird line");

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: New line character in c and how to use it?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How newline character formed?

The newline or line-feed character is denoted by ASCII code 0x0A (decimal 10). In C, we use the escape-sequence '\n' to denote a new line. In some cases, particularly where the output is directed to a line printer, a newline is immediately preceded by a carriage return character, 0x0D (13 decimal), which is denoted by the escape sequence '\r' in C. Thus you will often encounter the "\r\n" escape sequence at the end of each line of ASCII text.


What is value of enter key then how to get that value in c?

The new line character ('\n') has the ASCII value 10 decimal, 0x0A hexadecimal. In some cases, a new line may be preceded with a carriage-return (ASCII 13 decimal, 0x0D hexadecimal), however the carriage return is only of relevance to line printers. To determine when the enter key is pressed, capture the character via stdin and test for equality with the '\n' character.


C with the line over it mean with?

A lower case c with a horizontal line above it means "with". This character might be seen as instructions for medication "should be taken "with" food"


Which character comprise the c character set?

C does not use, nor requires the use of, every character found on a modern computer keyboard. The only characters required by the C Programming Language are as follows:A - Za -z0 - 9space . , : ; ' $ "# % & ! _ {} [] () $$$$ &&&& |+ - / * =The use of most of this set of characters will be discussed throughout the course.


What is the function on endl in c plus plus?

std::endl means end line, and is typically used to insert a new-line character in an output stream using the insertion operator (<<). This is really no different to inserting the '\n' character code to the output stream, however it also serves to flush the output buffer by writing all unwritten characters to the output stream. When used as a global function, std:endl(ostream& OS) can be used to insert a new-line character and flush the given output stream. The return value is a reference to the output stream itself thus it can be used in compound statements that make use of the return value.

Related questions

How newline character formed?

The newline or line-feed character is denoted by ASCII code 0x0A (decimal 10). In C, we use the escape-sequence '\n' to denote a new line. In some cases, particularly where the output is directed to a line printer, a newline is immediately preceded by a carriage return character, 0x0D (13 decimal), which is denoted by the escape sequence '\r' in C. Thus you will often encounter the "\r\n" escape sequence at the end of each line of ASCII text.


How newline formed?

The newline or line-feed character is denoted by ASCII code 0x0A (decimal 10). In C, we use the escape-sequence '\n' to denote a new line. In some cases, particularly where the output is directed to a line printer, a newline is immediately preceded by a carriage return character, 0x0D (13 decimal), which is denoted by the escape sequence '\r' in C. Thus you will often encounter the "\r\n" escape sequence at the end of each line of ASCII text.


Is it possible to skip to a new line when reading from a file in c plus plus?

To skip to a new line when reading from a file, assuming you are using a sequentially organized file, the usual case, you need to read and discard characters until you encounter the end-of-line character.


What is value of enter key then how to get that value in c?

The new line character ('\n') has the ASCII value 10 decimal, 0x0A hexadecimal. In some cases, a new line may be preceded with a carriage-return (ASCII 13 decimal, 0x0D hexadecimal), however the carriage return is only of relevance to line printers. To determine when the enter key is pressed, capture the character via stdin and test for equality with the '\n' character.


C with the line over it mean with?

A lower case c with a horizontal line above it means "with". This character might be seen as instructions for medication "should be taken "with" food"


Which character comprise the c character set?

C does not use, nor requires the use of, every character found on a modern computer keyboard. The only characters required by the C Programming Language are as follows:A - Za -z0 - 9space . , : ; ' $ "# % & ! _ {} [] () $$$$ &&&& |+ - / * =The use of most of this set of characters will be discussed throughout the course.


A is a formatting mark at the end of a line that moves the insertion point to the beginning of the next physical line?

a. paragraph break character b. nonbreaking space c. line break character d. nonbreaking hyphen ?which one is it?


What is the use of c plus plus function atoi?

Converts a character to integer (if it is a numeric character)


The New England nun is an example of?

for pennfoster it is C. a character study


Why you use ctype.h in c language?

it contains the information used by character classification and character conversion macros


Is C or Cpp better to use for game programming?

C++ is basically an object-oriented version of C (with a whole new set of capabilities). Most video games seem to lend themselves to an object-oriented. Class Character Class Player inherits from Character Class Enemy inherits from Character Class EasyEnemy inherits from Enemy Class HardEnemy inherits from Enemy etc.


What is the function on endl in c plus plus?

std::endl means end line, and is typically used to insert a new-line character in an output stream using the insertion operator (<<). This is really no different to inserting the '\n' character code to the output stream, however it also serves to flush the output buffer by writing all unwritten characters to the output stream. When used as a global function, std:endl(ostream& OS) can be used to insert a new-line character and flush the given output stream. The return value is a reference to the output stream itself thus it can be used in compound statements that make use of the return value.