Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
a local clone.
Formatted Output Solutions
Formatted Output Dersi Problem Çözümleri
- We have already seen that this is trivial with format specifiers:
import std.stdio; void main() { writeln("(Enter 0 to exit the program.)"); while (true) { write("Please enter a number: "); long number; readf(" %s", &number); if (number == 0) { break; } writefln("%1$d <=> %1$#x", number); } }
- Remembering that the
%
character must appear twice in the format string to be printed as itself:import std.stdio; void main() { write("Please enter the percentage value: "); double percentage; readf(" %s", &percentage); writefln("%%%.2f", percentage); }
Copyright © 1999-2025 by the D Language Foundation | Page generated by
Ddoc on Sun Aug 24 07:18:01 2025