Click here to Skip to main content
15,878,231 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.
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
0x01AA 3-Oct-22 12:34pm    
CPallini 3-Oct-22 16:02pm    

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