A<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://cppe.ru/index.php?action=history&amp;feed=atom&amp;title=C_Tutorial%2Fprintf_scanf%2Fprintf_Basics</id>
		<title>C Tutorial/printf scanf/printf Basics - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://cppe.ru/index.php?action=history&amp;feed=atom&amp;title=C_Tutorial%2Fprintf_scanf%2Fprintf_Basics"/>
		<link rel="alternate" type="text/html" href="http://cppe.ru/index.php?title=C_Tutorial/printf_scanf/printf_Basics&amp;action=history"/>
		<updated>2026-04-09T11:28:14Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://cppe.ru/index.php?title=C_Tutorial/printf_scanf/printf_Basics&amp;diff=3734&amp;oldid=prev</id>
		<title> в 14:21, 25 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://cppe.ru/index.php?title=C_Tutorial/printf_scanf/printf_Basics&amp;diff=3734&amp;oldid=prev"/>
				<updated>2010-05-25T14:21:19Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 14:21, 25 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://cppe.ru/index.php?title=C_Tutorial/printf_scanf/printf_Basics&amp;diff=3735&amp;oldid=prev</id>
		<title>Admin: 1 версия:&amp;#32;Импорт контента...</title>
		<link rel="alternate" type="text/html" href="http://cppe.ru/index.php?title=C_Tutorial/printf_scanf/printf_Basics&amp;diff=3735&amp;oldid=prev"/>
				<updated>2010-05-25T10:32:33Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия: Импорт контента...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==A format specifier: how to print the data==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;%d is one of the format specifiers for integer.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
main(){&lt;br /&gt;
    int i,j,k;&lt;br /&gt;
   &lt;br /&gt;
    i = 6;    &lt;br /&gt;
    j = 8;&lt;br /&gt;
    k = i + j;&lt;br /&gt;
   &lt;br /&gt;
    printf(&amp;quot;sum of two numbers is %d \n&amp;quot;,k);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;sum of two numbers is 14&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==d, i: Signed integers==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
main()&lt;br /&gt;
{&lt;br /&gt;
    int i = 100;&lt;br /&gt;
    printf(&amp;quot; %d\n&amp;quot;,i);&lt;br /&gt;
    printf(&amp;quot; %i\n&amp;quot;,i);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;100&lt;br /&gt;
      100&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Do calculation in printf==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
main (){&lt;br /&gt;
  float fRevenue, fCost;&lt;br /&gt;
  fRevenue = 0;&lt;br /&gt;
  fCost = 0;&lt;br /&gt;
  printf(&amp;quot;\nEnter total revenue: &amp;quot;);&lt;br /&gt;
  scanf(&amp;quot;%f&amp;quot;, &amp;amp;fRevenue);&lt;br /&gt;
  printf(&amp;quot;\nEnter total cost: &amp;quot;);&lt;br /&gt;
  scanf (&amp;quot;%f&amp;quot;, &amp;amp;fCost);&lt;br /&gt;
  printf(&amp;quot;\nYour profit is $%.2f\n&amp;quot;, fRevenue - fCost);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Enter total revenue: 1&lt;br /&gt;
      &lt;br /&gt;
      Enter total cost: 2&lt;br /&gt;
      &lt;br /&gt;
      Your profit is $-1.00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Placeholders==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The general form of a placeholder is: % flags field-width precision prefix type-identifier.&amp;lt;/p&amp;gt;&lt;br /&gt;
4.1.printf Basics&lt;br /&gt;
4.1.1.&lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/C/0080__printf-scanf/TheprintfFunction.htm&amp;quot;&amp;gt;The printf Function&amp;lt;/a&amp;gt;&lt;br /&gt;
4.1.2.&lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/C/0080__printf-scanf/TheprintfConversionCharactersandflags.htm&amp;quot;&amp;gt;The printf() Conversion Characters and flags&amp;lt;/a&amp;gt;&lt;br /&gt;
4.1.3.&lt;br /&gt;
Placeholders&lt;br /&gt;
4.1.4.&lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/C/0080__printf-scanf/diSignedintegers.htm&amp;quot;&amp;gt;d, i: Signed integers&amp;lt;/a&amp;gt;&lt;br /&gt;
4.1.5.&lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/C/0080__printf-scanf/printfEscapeSequences.htm&amp;quot;&amp;gt;printf() Escape Sequences&amp;lt;/a&amp;gt;&lt;br /&gt;
4.1.6.&lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/C/0080__printf-scanf/Theprintffunctionredirectstheoutputtoastandardoutputwhichistheoutputonscreen.htm&amp;quot;&amp;gt;The printf() function redirects the output to a standard output, which is the output on screen&amp;lt;/a&amp;gt;&lt;br /&gt;
4.1.7.&lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/C/0080__printf-scanf/Aformatspecifierhowtoprintthedata.htm&amp;quot;&amp;gt;A format specifier: how to print the data&amp;lt;/a&amp;gt;&lt;br /&gt;
4.1.8.&lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/C/0080__printf-scanf/Usemultipleconversionspecifiersinasingleprintfstatement.htm&amp;quot;&amp;gt;Use multiple conversion specifiers in a single printf statement&amp;lt;/a&amp;gt;&lt;br /&gt;
4.1.9.&lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/C/0080__printf-scanf/Docalculationinprintf.htm&amp;quot;&amp;gt;Do calculation in printf&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==printf() Escape Sequences==&lt;br /&gt;
&lt;br /&gt;
Sequence&lt;br /&gt;
Meaning&lt;br /&gt;
\a&lt;br /&gt;
Beeps the speaker&lt;br /&gt;
\b&lt;br /&gt;
Backspace (moves the cursor back, no erase)&lt;br /&gt;
\f&lt;br /&gt;
Form feed (ejects printer page; may clear the screen on some computers)&lt;br /&gt;
\n&lt;br /&gt;
Newline, like pressing the Enter key&lt;br /&gt;
\r&lt;br /&gt;
Carriage return (moves the cursor to the beginning of the line)&lt;br /&gt;
\t&lt;br /&gt;
Tab&lt;br /&gt;
\v&lt;br /&gt;
Vertical tab (moves the cursor down a line)&lt;br /&gt;
\\&lt;br /&gt;
The backslash character&lt;br /&gt;
\&amp;quot;&lt;br /&gt;
The apostrophe&lt;br /&gt;
\&amp;quot;&lt;br /&gt;
The double-quote character&lt;br /&gt;
\?&lt;br /&gt;
The question mark&lt;br /&gt;
\0&lt;br /&gt;
The &amp;quot;null&amp;quot; byte (that&amp;quot;s 0, not the letter O)&lt;br /&gt;
\Onn&lt;br /&gt;
A character value in octal (base 8)&lt;br /&gt;
\xnnn&lt;br /&gt;
A character value in hexadecimal (base 16)&lt;br /&gt;
&lt;br /&gt;
==The printf() Conversion Characters and flags==&lt;br /&gt;
&lt;br /&gt;
Conversion Character&lt;br /&gt;
Displays Argument (Variable&amp;quot;s Contents) As&lt;br /&gt;
%c&lt;br /&gt;
Single character&lt;br /&gt;
%d&lt;br /&gt;
Signed decimal integer (int)&lt;br /&gt;
%e&lt;br /&gt;
Signed floating-point value in E notation&lt;br /&gt;
%f&lt;br /&gt;
Signed floating-point value (float)&lt;br /&gt;
%g&lt;br /&gt;
Signed value in %e or %f format, whichever is shorter&lt;br /&gt;
%i&lt;br /&gt;
Signed decimal integer (int)&lt;br /&gt;
%o&lt;br /&gt;
Unsigned octal (base 8) integer (int)&lt;br /&gt;
%s&lt;br /&gt;
String of text&lt;br /&gt;
%u&lt;br /&gt;
Unsigned decimal integer (int)&lt;br /&gt;
%x&lt;br /&gt;
Unsigned hexadecimal (base 16) integer (int)&lt;br /&gt;
&amp;lt;p&amp;gt;Flags for printf&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;OL&amp;gt;&amp;lt;LI&amp;gt;Width specifiers&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;Precision specifiers&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;Input-size modifiers&amp;lt;/LI&amp;gt;&amp;lt;/OL&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The printf Function==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;OL&amp;gt;&amp;lt;LI&amp;gt;printf displays information on screen.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;printf returns the number of characters printed.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;printf displays the text you put inside the double quotes.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;printf requires the backslash character - an escape sequence - to display some special characters.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;printf can display variables by using the % conversion character.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;printf format: a string argument followed by any additional arguments.&amp;lt;/LI&amp;gt;&amp;lt;/OL&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
main()&lt;br /&gt;
{&lt;br /&gt;
    int i = 0;&lt;br /&gt;
    &lt;br /&gt;
    i=printf(&amp;quot;abcde\n&amp;quot;);   &lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;total characters printed %d\n&amp;quot;,i);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;abcde&lt;br /&gt;
     total characters printed 6&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The printf() function redirects the output to a standard output, which is the output on screen==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
main(){&lt;br /&gt;
  printf(&amp;quot;Hi \n&amp;quot;);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Hi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use multiple conversion specifiers in a single printf statement==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
main(){&lt;br /&gt;
   &lt;br /&gt;
    char firstInitial, middleInitial, lastInitial;&lt;br /&gt;
    firstInitial= &amp;quot;M&amp;quot;;&lt;br /&gt;
    middleInitial= &amp;quot;A&amp;quot;;&lt;br /&gt;
    lastInitial= &amp;quot;V&amp;quot;;&lt;br /&gt;
    printf(&amp;quot;My Initials are %c.%c.%c.&amp;quot;, firstInitial, middleInitial, lastInitial);&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;My Initials are M.A.V.&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>