You can use the + flag of printf to print positive numbers with a leading + sign as:
printf("%+d %+d",10,-10); // prints +10 -10
You can use the + flag of printf to print positive numbers with a leading + sign as:
printf("%+d %+d",10,-10); // prints +10 -10