Basics

Kxlr S[ To properly format code, you must keep several concepts in mind. Whitespace is where you control the density of your code;this whitespace includes blank lines. Also, consider the amount of code on each line, as well as indention. Indention is a key part of giving structure to your code. You will need to know your language's proper syntax when formatting your code. The key parts of the formatting that are affected by syntax are how you show a line continuation, a line end, and the keywords used for comments. The line end is notated by the semicolon (;) and the line continuation is the carriage return and line feed (just strike the enter key in your editor). In C# you can comment a single line or multiple lines. A single line is notated by // and a multiple line is notated by /* at the beginning of the first line and */ at the end of the last line.

™ Type the remaining code, adding comments on the line before the code.

To create a flower box, type / to specify a multiple line comment.

—0 Type in the details of the class.

To end the flower box, type / to specify the end of a multiple line comment.

Type public static void Main() followed by { }, placing the opening and closing curly braces on separate lines, to create the Main function.

± With in he Main function, add a single line comment by typing //.

™ Type the remaining code, adding comments on the line before the code.

Was this article helpful?

0 0

Post a comment