Home  >  Article  >  Backend Development  >  What does % mean in C language

What does % mean in C language

hzc
hzcOriginal
2020-06-22 15:26:5624298browse

What does % mean in C language

#What does % mean in C language?

1. Modulo operation, that is, finding the remainder.
The expression a%b is the remainder obtained by dividing a by b.
For example: the result of 4%3 is 1

2. The escape character

, for example, often appears in input parameters in scanf() and printf() Variables with % represent parameter types, such as %d, %f, etc.

1.100%10 这时候%是取模,即取余数
2.printf("%d",10);这时候%是格式输出控制,后面的d表示这里要代入一个整数,也就是后面那个10

Recommended tutorial: "c Language"

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

Statement:
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