Home > Back-end >  When DEV 5.11 C printf display problems
When DEV 5.11 C printf display problems

Time:11-28

Dear bosses, I ask, why in the DEV 5.11 when using printf to c + + program content and the actual display window inconsistent phenomenon, how should solve? Have a big help solve doubt?

Program content is a mixture of simple operation, the source code below
Int main ()
{
int a;

Printf (" 5/4-6 + 2=% d \ n ", 6 + 5/4-2);
Printf (" 2 + 2 * (2 * 2, 2) % two-thirds=% d \ n ", 2 + 2 * (2 * 2, 2) % 2/3);
Printf (" 10 + 9 * (6) (7) 8 + % 4% + 5 * 3 * 2 + 3=% d \ n ", 10 + 9 * (6) (7) 8 + % 4% + 5 * 3 * 2 + 3);
Printf (" 1 + 2 + 3 + 4) * (5 * 6% (7/8) - 9) * 10=% d \ n ", 1 + 2 + (3 + 4) * (6%, 7/8) (5 * - 9) * 10);
return 0;
}
But is wrong, will be displayed after running % of the total

CodePudding user response:

To display in the printf %, should use "% %" in the output,

CodePudding user response:

reference 1st floor Tryagain2006 response:
to display in the printf %, should use "% %" for output,
what reason is this? Just test and solved

CodePudding user response:

refer to the second floor qzf1603 response:
Quote: refer to 1st floor Tryagain2006 response:
to display in the printf %, should use "% %" for output,
what reason is this? Just test, solve the

In print f, % is a special meaning, to display % as characters, it is necessary to use % % format specification, this is similar to the escape character "",

CodePudding user response:

reference Tryagain2006 reply: 3/f
Quote: refer to the second floor qzf1603 response:
Quote: refer to 1st floor Tryagain2006 response:
to display in the printf %, should use "% %" for output,
what reason is this? Just test, solve the

In printf, % has a special meaning, to display % as characters, it is necessary to use % % format specification, this is similar to the escape character "",
OK, thank you ~ ~

CodePudding user response:

Cout?
  • Related