当前位置:网站首页>How to output the percent sign "%" in printf function in C language
How to output the percent sign "%" in printf function in C language
2022-06-11 07:43:00 【Zhangxueheng】
Listen to today c A whim occurred during the language online class , How to record the efficiency of reading ? for example , I have a good book , All in all 200 page , I read it today 20 page , So I read 10 percent , That is to say %10, But how does this work c What about the language ? So here's the code :
I am a c Language novice , I feel like I can write one under the premise of the code I want to write c Language program , It's a big improvement for me .% The use of No. 1 made me begin to explore :
Is a direct input % Number

Still output like this /%

Or it can be output like this \%

Finally, I learned that , You need to write it like this to get the percentage sign I want to output %

Here is just a basic input and output , test %%%d Whether the output can be successful % Number .
The conclusion is that if you want to output a percent sign % Before the data you want to express ( namely %d perhaps %f perhaps %lf) Add two percent signs .
Wrote this , I suddenly have another question , What would happen if the three percent signs were separated ?
I'll try , Explain the conclusion by procedure !



I'm using the two symbols for percent % A space is added between the numbers , A space is added before and after the two percent signs that represent the percent sign , The results show that , The two percent signs still represent % Output No , The interval can only be separated from the number to be output later , And there is also a distance from the previous characters .
study hard , Day day up . This is a conclusion ! Instead of a simple sentence , Let's work together ! Common progress !
边栏推荐
- [codeforces1019e] raining season
- .NET C#基础(6):命名空间 - 有名字的作用域
- Zero foundation self-study SQL course | union joint query
- What exactly is PMP?
- wordcloud的使用
- Sdl-2 thread logic
- [atcoder1980] mystious light (mathematical simulation)
- The maximum number of divisors of numbers in the int range is 1536
- [untitled] Weng_ C lesson 1
- 【AtCoder2387】+/- Rectangle
猜你喜欢

Summary of classic interview questions

Several transaction modes of Seata

3年功能测试拿8K,被新来的反超,其实你在假装努力

【IoT】智能硬件:如何获取硬件产品的wifi信号强度

【AtCoder2306】Rearranging(拓扑)

【CodeForces1019E】Raining season(边分治+斜率优化)

2022.5.30-6.5 AI行业周刊(第100期):三年时光

Post-processing of ffmpeg miscellaneous notes

QT table display data

黑群晖DSM7.0.1物理机安装教程
随机推荐
Sdl-2 thread logic
Ffmpe a small demo to understand 80% of common APIs
MFC custom string linked list
SQLZOO刷题记录-3
20200730 T3 small B farm [maximum perimeter empty rectangle (monotone stack + line segment tree)] & "ROI 2017 day 2" learning track
【AtCoder1984】Wide Swap (拓扑排序转化)
Wc2020 guessing game
排序——选择排序
[atcoder2376] black and white tree (game)
QT picture adaptive display control
2. Graduated from this course, and the bank has outsourced testing work for more than 4 months. Talk about some real feelings
Simple use of string
【AtCoder2305】Decrementing(博弈)
排序——归并排序
Pat class A by category
Uoj 551 [unr 4] campus stroll [good polynomial questions (FOG)]
C language function stack frame
After 4 years of naked resignation from the test, the test post of 15K interview was rubbed on the ground, and the result made me collapse and cry
C language to write a calculator MVC (very interesting code architecture callback and constructor mode and the use of pointer functions)
QT table display data