How to print unsigned int in C

2 Answers

0 votes
#include <stdio.h>
#include <limits.h>
 
int main(void) {
    unsigned int ui = UINT_MAX;
     
    printf("%u", ui);
    
    return 0;
}
 
 
 
/*
run:
 
4294967295
 
*/

 



answered Jan 4, 2021 by avibootz
0 votes
#include <stdio.h>

int main(void) {
    unsigned int ui = 0;
    
    printf("%u", --ui);
    
    return 0;
}



/*
run:

4294967295

*/

 



answered Jan 4, 2021 by avibootz

Related questions

1 answer 171 views
171 views asked Dec 29, 2023 by avibootz
1 answer 201 views
1 answer 167 views
2 answers 177 views
3 answers 176 views
176 views asked Feb 9, 2023 by avibootz
1 answer 167 views
...