C # programming: Input and Output,

Source: Internet
Author: User

C # programming: Input and Output,

C # Programming

Main Function

Static void Main (string [] args)
{
}

The program must be written in braces of the main function.

I. Output:
Console. WriteLine ("string to be output ");
Note:
1. case sensitive.
2. All symbols must be in English.
3. Do not miss the semicolon.
Console. Write ("the string to be output"); // No line breaks will be generated later.

Example

Ii. input:
String s = Console. ReadLine ();
String-string type
S-A container dedicated to storing string content
=-Assign a value to send the right to the left.
Console. ReadLine () -- read the input content from the Console.
This sentence means:
Read your input content from the console, and put the read content in a container s that specifically stores the string content.

Example

3. Comment: Method 1: select the corresponding row and click "comment selected row" in the toolbar ". Method 2: select the corresponding row and press Ctrl + K Ctrl + C; uncomment: Ctrl + K Ctrl + U method 3: manual comment. Add // (comment a whole line)/***/comment a piece of content before the code line.

Tip: 1. Try to use the smart sensing function for written code. 2. Write the overall information first, and then complete the details. 3. The word function is automatically completed. Alt + right cursor

Case: Enter the name, age, and unit. The sentence is displayed as a smooth sentence.

Example

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.