First-Contact C #

Source: Internet
Author: User
Tags bitwise operators

The first day of contact with C # is very interesting, we start with a console output Hello,world, we first learned the simple process of compiling the code, tools for developing software vs. Learn the components of code compilation, divided into main functions, declarations, function body, and then to the console output statement hello,world. The first day of learning is very simple, but also let me have a new understanding of the computer.

Later we learned 4 data types string (string) char (character) int (integer) double (decimal), understand what is called a variable, which is used to store data in memory, where the data can be changed, the variable names must be consistent when the variables are declared and assigned, the type must match, Needs to be declared first, then assigned. The syntax of a variable is written as: The data type space variable name = data, where the data type is represented by a string char int double, the variable name is the developer's own name, can only be composed of numbers, letters, underscores, must not start with a number, the name cannot be the same as the data type. Also, variable names must not be the same in the same function. Then we learn the operation of the data, which is divided into two categories, one is the number operation, the other is the string operation. A numeric operation is simply to assign two or more data types, let them add (+), subtract (-), multiply (*), divide (/), and (%). And the string operation is the concatenation between many strings, the concatenation symbol is (+), for example "1" + "2" + "3" The result is "123". Next comes a more important thing, type conversion.  int and double convert string: The data to be converted.  ToString (); 。 The string is converted to int with double:int and double followed by a. Parse on the line. An int and a double are converted to int, and the double is converted to int, for example:

Double a  3.14; int d = (int) A

This code is converted after the fractional part is discarded directly, and the variable D is 3. Then we made a circular area circumference calculator, the process for the calculator, the first time to do or feel more difficult.

Then we study the classification of some number types, which are divided into real numbers and integers. where float retains up to 7 significant digits in the real type, and double is 15, decimal can be given a precise decimal. Then, in the knowledge of the operators, we learned the parentheses, arithmetic operators, assignment operators, logical operators, trinocular operators, bitwise operators, respectively. Arithmetic operator + +-These two operations are more important and require special control. A logical operator is an operator used to determine whether a condition is established, using true and false representations to determine the result.  How to write the trinocular operator: operand 1? Operand 2: operand 3;. where operand 1 must be of type bool, and 2 and 3 must be of the same type.

These are the days of learning some things, the first time to write a blog, try to, do not know how to write, so it

First-Contact C #

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.