What does % mean in C language

hzc
Release: 2020-06-22 15:26:56
Original
24299 people have browsed it

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
Copy after login

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!

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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template