Input output comment Case common data conversion constant operator classification precedence

Source: Internet
Author: User
Tags float double

(i) Input and output

Console.ReadLine (); Input statement

Console.WriteLine (); Output Statement Wrap Line

Console.Write (); Output statement does not wrap

(ii) Notes

Comment Line

/* * * comment on an area

Put it on the function and annotate the function.

(c) Case

Console.Write ("Please enter Name:");

String name = Console.ReadLine ();

Console.Write ("Please enter Age:");

String age = Console.ReadLine ();

Console.Write ("Please enter work unit:");

String Danwei = Console.ReadLine ();

Console.Write ("Please Enter education:");

String Xueli = Console.ReadLine ();

Console.Write ("Please enter Gender:");

String Xingbie = Console.ReadLine ();

Console.Write ("Please enter your ID number:");

String sfz = Console.ReadLine ();

Console.WriteLine ("I call" + name + ", this year" + Age + "years old, in" + Danwei + "work");

Console.WriteLine ("My Education is" + Xueli + ", my gender is" + Xingbie + ", my ID number is" + SFZ + ");

(iv) Common data

Data type

Shaping: int Long

Float type: float double

Character type: Char

Boolean type: BOOL

String Type: String

Date Type: Date Time

Enum type: enum

struct type: struct

(v) Conversion

Automatic conversion (implicit conversion)-when converting from a value type to a reference type

Casts (explicit conversions)-when converting from a reference type to a value type, or from a floating-point type to an integral type

(vi) Classification precedence of operators

Arithmetic: + + (Gaga)-(minus) * (multiply)/(except)% (take-up) + (plus)-(minus)

Relationship:> (greater than) < (less than) >= (greater than or equal) <= (less than or equal)

Logic:&& (for (and)) | | (OR)! Non-

Conditional operator:? : (Only one ternary operator if)

Assignment: = + = = *=/=%= (for example: x-=4, or x=x-4)

Input output comment Case common data conversion constant operator classification precedence

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.