Home > Backend Development > C#.Net Tutorial > What does c language % mean?

What does c language % mean?

coldplay.xixi
Release: 2020-08-13 10:18:25
Original
78008 people have browsed it

c language % means: 1. The remainder symbol is often used to determine whether one number is divisible by another; 2. The guide symbol is used to guide the format of the input and output items.

What does c language % mean?

c language % means:

1, % is The remainder symbol is often used to determine whether one number is divisible by another.

For example: 7%3=1 (7 divided by 3, the remaining 1,) 1%3=1 (1 divided by 3 cannot be divided, the remaining 1);

If it is judged that an m is Odd or even number if(m%2==0) printf("even number").

2. The guide character is used to guide the format of the input and output table columns.

For example: printf("%d%c%f",a,b,c); means a is output in integer type, b is output in character type, and c is output in real type.

What does c language % mean?

Related learning recommendations: C video tutorial

Extended information

Basic features

1. High-level language: It is a unit of work that combines the basic structures and statements of high-level languages ​​with the practicality of low-level languages.

2. Structural language: The distinctive feature of structural language is the separation of code and data, that is, each part of the program is independent of each other except for necessary information exchange.

This structured approach can make the program hierarchy clear and easy to use, maintain and debug. C language is provided to users in the form of functions. These functions can be easily called and have a variety of loops and conditional statements to control the program flow, thus making the program completely structured.

3. Code-level cross-platform: Due to the existence of standards, almost the same C code can be used in multiple operating systems, such as Windows, DOS, UNIX, etc.; it is also applicable to multiple machine models. C language is superior to other high-level languages ​​for situations where hardware operations are required for writing.

4. Use pointers: You can directly perform operations close to the hardware, but C's pointer operations are not protected, which also brings many unsafe factors to it. C has made improvements in this area, retaining pointer operations while enhancing security, and has been supported by some users.

However, because these improvements increase the complexity of the language, they have also been criticized by others. Java has learned the lessons of C, canceled pointer operations, and also canceled some controversial aspects of C's improvements. It has achieved good results in terms of security and suitability, but it itself explains that it runs in a virtual machine. Efficiency is lower than C/C.

Generally speaking, C, C, and Java are regarded as languages ​​of the same family, and they have long occupied the top three programs in the list.

Related recommendations: Programming video course

The above is the detailed content of What does c language % mean?. 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