-
Arithmetic Operator:
Addition operators.
Subtraction operators.
Multiplication operators.
Division operator.
Remainder Operator The mod operator is used to find remainder, which is to find the remainder of two numbers.
The precedence of arithmetic operators is the same as in mathematics: parentheses first, multiplication and division later, addition and subtraction.
For example, a=3+5 gives the result of the expression to the right of the 8 equal sign and puts it into the a variable. Put the result into a variable, which is equal to a=8
a=5-2 to get 3
a=3*2 gives 6
a=4 2 gives 2
a=31%21 gives 10
Relational Operator:
The so-called "relational operations" are actually "comparative operations".
C provides the following six types of relational operators.
Less than. = Less than or equal to.
Greater than. = Greater than or equal to.
Same priority (high)*
Whether it is equal to. Whether it is not equal.
Same priority (low)*
Three constructs of C language programming.
Sequential structure (executed from top to bottom).
Select the structure (select to execute a segment).
Loop structure (loop execution of a segment**).
Logical Operator:
There are three logical operators provided by the C language:
and (equivalent to and and).
or (equivalent to or or).
Non (equivalent to not negating).
Example: a&&b If a, b is true, then a&&b is true.
a||b If one of a and b is true, then a||b is true.
a If a is true, then! A is false, if your expression is true, it will not be true after it is reversed. If your expression doesn't hold, it will hold after it is negated.
Operator precedence.
Non) arithmetic operator (+ %)
Relational Operator:=)
and ||(and or).
Assignment operator (=).
The above order is from highest to lowest, and if you want to prioritize low-level operators, you need to enclose them in parentheses.
For example: if ((a<30&&b>5000)||a>30&&b>30000)) *If a is less than 30 and greater than 5000 or a>30 and greater than 30000, in this paragraph, the && symbol is executed after the relative operator is executed, and ||The symbol is also executed after the entire paragraph in parentheses
-
Foundation, Tan Haoqiang's C book, not bad, go take a look. There is also a very important way to exercise your own logic.
-
1.Algorithm + Data Structure;
2.Practice more on the computer and understand every sentence.
-
The most important thing is to find an experienced person to take you.
-
First, open VS2013 and find that there is a new project.
and Open Project.
, select New Project.
After that, there will be an interface for creating a new project, and there are various language writing environments on the left, such as vb, vc, vc++, if you write c language, choose vc++, because c++ is basically compatible with c language. At this time, the project does not need to add a suffix, which is equivalent to a big project.
Select the type, write the project name, and click OK.
Click Next.
Here's the key. Tick the empty project,If you don't select it, because the program will add some ** for you by default.,Sometimes there will be compilation errors when you don't need it.。 Relatively suitable for beginners.
At this point, you have created a new project, right-click the source file to add the new project.
After adding a new item, the ** of the c language must be modified with the suffix, which will. cpp instead. c, explain to the program that there is a c language ** at this time.
After writing, debugging and running, if there is no writing to let the program stay, don't press f5 directly, you can press ctrl+f5 to debug.
Usually the default is debug, if you finish developing a program for others to use, you have to choose the release version of the debugging, so that others can also use it in the environment without VS. Share.
Whoever learns programming now, if you want to learn it, you can learn the bidding course of Xingzhou IT.
The school should have a lot of computer labs, right? If you really want to learn the computer well, the time on the computer must be guaranteed, you can go to the computer room, but the disadvantage is that it costs money (but the general school computer room is not expensive), and it is inconvenient, and your own information or something has to be copied again every time. >>>More
Write a program with a computer - -
1. Master the basic principles, analysis methods and experimental skills of electronic technology and computer composition and architecture, and be able to engage in the development and design of computer hardware systems. >>>More
1.Simple, compact, flexible and convenient.
There are only 32 keywords and 9 control statements in the C language, and the program is written freely, mainly represented by lowercase letters. It combines the basic structure and sentences of a high-level language with the practicality of a low-level language. The C language can manipulate bits, bytes, and addresses in the same way as assembly language, which are the most basic units of work of a computer. >>>More