TAKTAK26 Member Joined Mar 17, 2019 Messages 23 Reaction score 1 Mar 28, 2020 #1 Friends, I have a problem. Whatever way I print the percentage value, I can not help. Can you help me? (Example %d% s and so on.)
Friends, I have a problem. Whatever way I print the percentage value, I can not help. Can you help me? (Example %d% s and so on.)
TAKTAK26 Member Joined Mar 17, 2019 Messages 23 Reaction score 1 Mar 28, 2020 #2 User has been warned for bumping the topic before 12 hours wait time. Help! Upvote 0 Downvote
_Safa Well-known member Joined Sep 22, 2019 Messages 297 Reaction score 103 Location UGBASE Mar 28, 2020 #3 For float use %0.1f etc. depending on after-comma digits. Upvote 0 Downvote
monday Expert Joined Jun 23, 2014 Messages 1,127 Solutions 1 Reaction score 158 Mar 28, 2020 #4 if your goal is to display "%" character itself, then use "%%". Example: C: #include <stdio.h> int main() { printf("%%"); return 0; } which outputs: % Upvote 0 Downvote
if your goal is to display "%" character itself, then use "%%". Example: C: #include <stdio.h> int main() { printf("%%"); return 0; } which outputs: %
monday Expert Joined Jun 23, 2014 Messages 1,127 Solutions 1 Reaction score 158 Mar 28, 2020 #5 So to print "100%" you would use something like: C: printf("%d%%", 100); Upvote 0 Downvote