Search
 
SCRIPT & CODE EXAMPLE
 

C

print octal number in c

%d - to print value in int format.
%o - to print value in octal format.
%x - to print value in hexadecimal format (letters will print in lowercase)
%lx - to print value in hex (long int) format (i.e any number > 0xFFFFFFFF (8Fs))
%X - to print value in hexadecimal format (letters will print in uppercase)
Comment

print octal in c

void print_octal(unsigned int n) {
    for (int i = 30; i >=0 ; i-=3) {{
            //                            0x7 = 111
            unsigned char x = ((n >> i) & 0x7);
            printf("%o",x);
    }

    }
}
Comment

PREVIOUS NEXT
Code Example
C :: user define 
C :: listas enlazadas/ linked lists 
C :: payement des véhicules a la sortie de station de langue c 
C :: To get file info 
C :: time to apply pmfby 
C :: c++ sum of ascii string 
C :: Returns number of values 
C :: programmation c 
C :: Write a c program to add two numbers without using addition operator. 
C :: C do...while loop 
C :: download file by command line windows 
C :: time random c 
C :: c check if is a right triangle 
Dart :: screen size flutter 
Dart :: flutter transparent appbar 
Dart :: flutter textfield label align top 
Dart :: flutter positioned center horizontally 
Dart :: canonical tag 
Dart :: flutter close app programmatically 
Dart :: dart switch 
Dart :: trailing flutter with 2 icons flutter 
Dart :: increase text size of Test flutter 
Dart :: flutter chip padding 
Dart :: custom error snackbar flutter 
Dart :: flutter tooltip padding 
Dart :: dart list remove range 
Dart :: splite number in dart 
Dart :: how to launch url in flutter web 
Dart :: flutter get operating system 
Dart :: dart getter 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =