Skip to content
EmbeddedTechTips
  • C Interview Questions
  • Raspberry Pi Pico
  • About Us

C Interview Questions

Check whether given number is Power of 2 using bitwise operators in C

May 7, 2021 by kumarabekur

Problem : Check whether given number is power of 2 using bitwise operators in C Algorithm : Let us see the binary representation of numbers which are power of 2: As we can see in above example,any number which is power of 2 has only 1 bit set. Now let us subtract 1 from above … Read more

Categories C Interview Questions Leave a comment

C Program to print the length of the string without using built-in function

May 7, 2021 by kumarabekur

One of the easiest ways to fine the length of the string in C is by using built-in function strlen. Using below code, we can find the length of the string without using any built-in functions. Output:

Categories C Interview Questions Leave a comment

How to check whether system is Big or Little Endian using C?

May 5, 2021 by kumarabekur

Problem : Write a optimized code to check whether the system is Big or Little Endian using C Understanding: Endianness of the system describes how the multibyte data are stored(int, float..etc). Let us take example of Big Endian vs Little Endian representation of number 0x11223344 Using above idea, we can use below program to check … Read more

Categories C Interview Questions Leave a comment

Count the number of bits set in an Integer using C

May 4, 2021May 4, 2021 by kumarabekur

Problem : Write a best approach to count the number of bits set in given integer number using C. Understanding : All the numbers can be represented in Binary Format. For example Number 5 can be represented as 0101. Our program should take number 5 as number and count the number of bits set and … Read more

Categories C Interview Questions Leave a comment

How to check if the machine running on is 32 or 64 bit in C?

May 1, 2021May 1, 2021 by kumarabekur

One of the easiest ways to find whether modern processor is 32-Bit or 64-Bit is by understanding the size of generic pointer(void*). Below is the C code which prints the 32/64 Bit:

Categories C Interview Questions Leave a comment

Recent Posts

  • Check whether given number is Power of 2 using bitwise operators in C
  • C Program to print the length of the string without using built-in function
  • How to check whether system is Big or Little Endian using C?
  • Count the number of bits set in an Integer using C
  • How to check if the machine running on is 32 or 64 bit in C?
© 2023 EmbeddedTechTips • Built with GeneratePress