当前位置:网站首页>C language learning
C language learning
2022-07-07 23:45:00 【Assass1n-】
C Language learning
1. Define constants
usage : #define Constant names value
const data type Constant names = value
2. integer int
Print format
| Print format | meaning |
|---|---|
| %d | Output one A signed Decimal system of int type |
| %o( Letter o) | Output 8 It's binary int type |
| %x | Output 16 It's binary int type , Letters are output in lowercase |
| %X | Output 16 It's binary int type , Output letters in uppercase |
| %u | Output one 10 It's binary An unsigned number |
Example
#include <stdio.h>
int main(void)
{
// data type identifier = value
// Unsigned unsigned A signed signed
signed a =-10;
//unsigned int a =10 This can be displayed normally If =-10 when There will be garbled code
printf("%d\n",a);// here unsigned It can output normally -10
//printf("%u\n",a);
return 0;
}
#include <stdio.h>
int main(void)
{
int a=10;
printf("%d\n",a);// Output 10
printf("%x\n",a);// Output a
printf("%X\n",a);// Output A
printf("%o\n",a);// Output 12
// Define octal data to 0 start
int b =0123;
// Definition 16 Hexadecimal data With 0x start
int c =0x123;
printf("%x\n",b);
printf("%X\n",b);
printf("%o\n",b);
printf("%x\n",c);
printf("%X\n",c);
printf("%o\n",c);
return 0;
}
边栏推荐
- SAP HR 劳动合同信息 0016
- Boost regex library source code compilation
- Live server usage
- 【实验分享】通过Console口登录到Cisco设备
- Take you hand in hand to build feign with idea
- postgres timestamp转人眼时间字符串或者毫秒值
- Wechat applet development beginner 1
- Chisel tutorial - 00 Ex.scala metals plug-in (vs Code), SBT and coursier exchange endogenous
- C # exchange number, judge to pass the exam
- redis缓存工具类,值得拥有~
猜你喜欢

Take you hand in hand to build feign with idea

平衡二叉树【AVL树】——插入、删除

List. How to achieve ascending and descending sort() 2020.8.6

C - linear table

ESP at installation esp8266 and esp32 versions

HB 5469民用飞机机舱内部非金属材料燃烧试验方法

C simple question one

SAP HR奖罚信息导出

Uic564-2 Appendix 4 - flame retardant fire test: flame diffusion

Ora-02437 failed to verify the primary key violation
随机推荐
95.(cesium篇)cesium动态单体化-3D建筑物(楼栋)
mysql8.0 ubuntu20.4
P1055 [noip2008 popularization group] ISBN number
KeePass realizes automatic input of web pages
C语言学习
Chisel tutorial - 02 Chisel environment configuration and implementation and testing of the first chisel module
Access database query all tables SQL
正畸注意事项(持续更新中)
35岁那年,我做了一个面临失业的决定
[experiment sharing] log in to Cisco devices through the console port
SAP HR奖罚信息导出
SAP memory parameter tuning process
Benchmarking Detection Transfer Learning with Vision Transformers(2021-11)
IDEA 2021.3. X cracking
二叉排序树【BST】——创建、查找、删除、输出
ASP. Net core middleware request processing pipeline
一份假Offer如何盗走了「Axie infinity」5.4亿美元?
Flash encryption process and implementation of esp32
数据湖(十五):Spark与Iceberg整合写操作
B_ QuRT_ User_ Guide(38)