VOOZH about

URL: https://www.geeksforgeeks.org/c/char_bit-in-c/

⇱ CHAR_BIT in C - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

CHAR_BIT in C

Last Updated : 27 May, 2022

CHAR_BIT : It is the number of bits in char. These days, almost all architectures use 8 bits per byte (But it is not the case always, some older machines used to have 7-bit byte). It can be found in Let us see an application of it. Suppose we wish to print byte by byte representation of an integer. 

Examples :

Input : 4
Output : 00000000 00000000 00000000 00000100

Input : 12
Output : 00000000 00000000 00000000 00001100 

Output :

00000000 00000000 00000000 00001100 

Time Complexity : O(32)

Auxiliary Space : O(32)

Comment
Article Tags:
Article Tags: