What is %o in printf function in the C programming language?

We use a printf function with %o format specifier to display the value of an octal variable.

%o - It is used for calculating octal value.

Ex:

  1. #include<stdio.h> 
  2. int main() 
  3. { 
  4. int i = 150; 
  5. printf("Octal value is: %o",i); 
  6. return 0; 
  7. } 

In the C programming language, there are various format specifier is present.

  • %d -> It is used for the integer value.
  • %c -> It is used for the character value.
  • %f ->  It is used for the floating value.
  • %s -> It is used for string value.

Comments

Popular posts from this blog

proassignment help backlink data index 41

programming shark backink data index 31

Programming shark backlink data index 67