Click here to Skip to main content
15,881,380 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
#include <stdio.h>

int main(void) {
  printf("12%2d45", 3); 
  return 0;
}


What I have tried:

The output of this code statement is 12 345.
Posted
Updated 3-Oct-22 5:42am

1 solution

The format string 12%2d45 consists of "12", "%2d" and 45. Since the number 3 is to be output with two digits, a space is inserted.
 
Share this answer
 
Comments
0x01AA 3-Oct-22 12:34pm    
+5
CPallini 3-Oct-22 16:02pm    
5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900