Home > Backend Development > C#.Net Tutorial > What is the expression of operator in C language?

What is the expression of operator in C language?

下次还敢
Release: 2024-05-08 11:57:19
Original
1156 people have browsed it

In C language, operators are represented by symbols and perform mathematical or logical operations. They are classified according to the following categories: 1. Arithmetic operators ( , -, , /, %); 2. Assignment operators (=, =, -=, =, /=); 3. Relational operators (==, ! =, <, >, <=, >=); 4. Logical operators (&, |, ^, !, &&, ||); 5. Bit operators (<<, > >, ~); 6. Other operators (&, *, sizeof, ->).

What is the expression of operator in C language?

#What is the representation of operators in C language?

In C language, operators are represented by symbols and are used to perform mathematical or logical operations. They are available for various data types such as integers, floating point numbers, characters, and strings.

Operators are divided into the following categories:

1. Arithmetic operators

  • Addition
  • - Subtraction
  • * Multiplication
  • / Division
  • %Remainder

2. Assignment operator

  • ##= Assignment
  • = Additive assignment
  • -= Subtractive assignment
  • *= Multiplicative assignment
  • /= Division assignment

3. Relational operator

  • == is equal to
  • != is not equal to
  • < is less than
  • > is greater than
  • <= Less than or equal to
  • >= Greater than or equal to

4. Logical operators

  • & Bitwise AND
  • | Bitwise OR
  • ^ Bitwise XOR
  • ! Not
  • && Logical AND
  • || Logical OR

5. Bit operators

  • << Left shift
  • >> Right shift
  • ~ Complement code

6. Other operators

  • & Address reference Symbol
  • * Dereference character
  • sizeof Obtain data type size
  • . Member access character
  • -> Pointer member accessor
In summary, operators in C language are represented by symbols. They perform mathematical or logical operations, and Classified by category, including arithmetic, assignment, relational, logical, bitwise, and other operators.

The above is the detailed content of What is the expression of operator in C language?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template