How to print positive numbers with plus sign in C

1 Answer

0 votes
#include <stdio.h>

int main(void) {
    int a = 23, b = -8;

    printf("%+i %+i\n", a, b);
    printf("%i %i\n", a, b);

    return(0);
}





/*
run:

+23 -8
23 -8

*/

 



answered May 4, 2021 by avibootz
...