2.c# input, output, and operator, data type

Source: Internet
Author: User

I. Definition of C # and its characteristics

C # is a new, simple, secure, object-oriented programming language that Microsoft released in July 2000 and is specifically designed for. NET, and the language developed by the application. It absorbs the advantages of C + +, Visual Basic, Delphi, Java and other languages, and embodies the features and essences of today's latest program design technology. NET Framework provides a powerful, easy-to-use, logical, and consistent program design technology environment for C #. At the same time, the common language (Common Language Runtime) provides a managed runtime environment for the C # programming language, making the program more stable and secure than ever before.

II. integrated development environment for Visual Studio.NET

. NET development language employs a unified, integrated development environment, Visual Studio.NET. described below.

(1) Visual Studio.NET start Page

After you start Visual Studio.NET, you first see a Start page as shown. On the Start page, you can open an existing project or create a new project.

(2) New visual1c#. NET Project

Click "File" → "new" → "Project" menu command in the upper left corner, the new Project dialog box will appear, in which you can choose a different programming language to create various projects that will share the Visual Studio.NET integrated development environment, as shown in.

Iii. output and input of C #

Create the console application. As shown in.

console. ReadKey(); //Input statement, do not wrap line

Console. ReadLine (); Input statement, wrap line

Console.Write (); Output statement, do not wrap line

Console.WriteLine (); Output statement, wrap line

string S=console. Readline (); where = equals assignment , string represents the character type, ands represents the container that holds the contents of the string specifically.

Note: All symbols must be entered in the English state, and the semicolon should not be omitted at the end.

Example: Please do a display name, year of birth, age, graduation school, work unit, contact information console, name, year of birth, age, graduation school, work unit, contact information must be entered at the front desk. As shown in the following:

Iv. notes

The content of the comment does not appear in the application.

Method One: Select the content you want to comment on, click "Comment Selected Rows" in the toolbar

Method Two: Select the content you want to comment, use the shortcut key Ctrl+k Ctrl + C; Uncomment: Use shortcut keys Ctrl+k ctrl+u

Method Three: Manual annotation. Note there is a line,/**/comments A section, such as:

V. Operators

Differences between pre + + and post + +:

int a=10,b=a++

A++====> can be written as int b=a int a=a+1

So a=11 b=10

int A=10,b=++a

++a====> can be written as int b=a+1 int a=a+1

So a=11 b=11

Vi. Types of data

Example: Please enter two numbers, then figure out two numbers, subtract, multiply, divide the result. Such as:

2.c# input, output, and operator, data type

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.