当前位置:网站首页>Arithmetic operations and expressions
Arithmetic operations and expressions
2022-06-25 14:46:00 【m0_ fifty-nine million nine hundred and forty-nine thousand fou】
The associativity of operators : The combination direction from right to left becomes “ Right binding ”.

Self increasing 、 Self - subtracting operator :
#include<stdio.h>
void main()
{
int i = 8;
printf("%d\n", ++i);
printf("%d\n",--i);
printf("%d\n", i++);
printf("%d\n", i--);
printf("%d\n", -i++);
printf("%d\n", -i--);
}
#include<stdio.h>
void main()
{
int i = 5, j = 5, p, q;
printf("%d\n,%d\n", i++, ++i);
printf("%d\n,%d\n", ++i, i++);
p = (i++) + (i++) + (i++);
q = (++j) + (++j) + (++j);
printf("%d,%d,%d,%d", p, q, i, j);
}Execution results :
6
,7
9
,7
27,24,12,8 Need later understanding
Type conversion
#include<stdio.h>
void main()
{
int a, b = 322;
float x, y = 8.8;
char c1 = 'k', c2;
a = y;
x = b;
a = c1;
c2 = b;
printf("%d,%f,%d,%c", a, x, a, c2);
} Execution results : Loss accuracy 
#include<stdio.h>
void main()
{
int a = 2, b = 4, c = 6, x, y;
y = (x = a + b), (b + c);
printf("y=%d,x=%d", y, x);
}Execution results :y=6,x=6
边栏推荐
- Power automatic test system nsat-8000, accurate, high-speed and reliable power test equipment
- Complete and detailed compilation of experimental reports
- Clinical chemistry | zhangjianzhong / Xu Jian develop single cell precision diagnosis and treatment technology for Helicobacter pylori
- Uniapp icon configuration
- 【Try to Hack】vulnhub DC1
- Position (5 ways)
- Jaspersoft studio installation
- Cool assembly tutorial - concise x86 assembly language tutorial (1)
- How to crop GIF dynamic graph? Take this picture online clipping tool
- None of the MLIR optimization passes are enabled (registered 2) solutions
猜你喜欢

Clinical Chemistry | 张建中/徐健开发幽门螺杆菌单细胞精准诊疗技术

Shell array

About the problem of kicad stuck in win10 version, version 6 x

搭建极简GB28181 网守和网关服务器,建立AI推理和3d服务场景,然后开源代码(一)

Two methods to rollback the code in pycharm to the specified version (with screenshot)

New good friend Pinia, leading the new era of state management

ffmpeg protocol concat 进行ts流合并视频的时间戳计算及其音画同步方式一点浅析

如何裁剪动图大小?试试这个在线照片裁剪工具

Variables, scopes, and variable promotion

How to view the Chrome browser plug-in location
随机推荐
JS Base64 Library Learning
还没弄明白微服务数据架构事务管理+ACID+一致性+CAP+BASE理论吗,看完彻底解决疑惑
In 2022, the score line of Guangdong college entrance examination was released, and several families were happy and several worried
[untitled]
【HBZ分享】LockSupport的使用
Basic usage of markdown (plain text and grammar)
Biscuit distribution
【世界历史】第二集——文明的曙光
现在股票开户用什么app最安全?知道的给说一下吧
Flexible layout (display:flex;) Attribute details
合宙Air32F103CBT6开发板上手报告
dmsetup命令
14 -- 验证回文字符串 Ⅱ
China has made major breakthroughs in battery technology. Japan, South Korea and the United States are lagging behind. China has consolidated its leading edge
To make pytorch faster, you need to master these 17 methods
【中国海洋大学】考研初试复试资料分享
Which is better and safer, GF easy gold rush or flush
15 -- 最接近原点的 K 个点
有哪个瞬间让你觉得这个世界出bug了?
【深度学习】多标签学习