Case Conversion using Bitwise
Upper Case to Lower Case: Lower Case to Upper Case:
Upper Case to Lower Case: Lower Case to Upper Case:
C Program to count the set bits:
To check if the number is multiple of 8, the bitwise way is that: first right shift by 3 and then left shift by 3. Multiple of 8 will remain the same as original number after this operation. Examples: 8: 1000 >> 3 : 0001 <<3 : 1000 24: 11000… Continue reading Multiples of 8
We can obtain 2’s complement in atleast two ways through a C program. If n is a number then -n will give the result. The next approach is to first flip all the bits (1’s complement) and then add 1. The bits can be flipped using ~ operator. The program below demonstrates both the approaches.
An odd number always has the LSB set to 1. If we AND the given number with 1, the even number will always turn out to be zero. We can using this to check if the number is odd or even. Examples: 1) n = 4 100 (4) 001 (1) ———– AND 000… Continue reading Check if Number is Odd Using Bitwise – C
Refer to theory HERE. Program to Convert Upper Case to Lower Case: Program to Convert Lower Case to Upper Case:
We generally use the functions strlwr() and strupr() available under string.h to toggle between the cases. This can also be achieved using bitwise operations. Before that, lets understand the ASCII table. ASCII of A is 65 (1000001) ASCII of a is 97 (1100001) Similarly, ASCII of Z is 97 (1011010) ASCII of z is 122 (1111010)… Continue reading Case Conversion using Bitwise – C
Lets talk them out!
the world of wonders with amazing words
My best traveling tips for your unforgettable journey.
There are always gonna be flaws in the plan. Nothing is perfect. Neither the blog, its url or the blogger. Make yourself home in the chaos.
collecting moments that stump
Welcome to your new home on WordPress.com
With sweet and sour experiences, life is full of colors
Every beat of my heart belongs to I AM! 💙
Impartial Everytime Always
The power of the python programming language unleashed.
Food Photography & Recipes
Embracing Complexity
Intelectual Emergence "The whole is greater than the sum of its parts"
... and in between
*~~BELLA GIRLSS FUR EVER~~*