Showing posts with label Bitwise Operators Demonstration in C. Show all posts
Showing posts with label Bitwise Operators Demonstration in C. Show all posts

Sunday, June 30, 2019

Bitwise Operators Demonstration in C

A simple program to show how to use Bitwise Operators in C programming language.

If you like my work please click the ads on my website to support my work. I will really appreciate your help. 

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

Sample Program Output



Program Listing

/* bitwise.c
   Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
   Date     : November 19, 2018  Monday 2:38 PM
   Location : Bacolod City, Negros Occidental
   Website  : http://www.jakerpomperada.com
   Emails   : jakerpomperada@jakerpomperada.com
              jakerpomperada@gmail.com
              jakerpomperada@yahoo.com
              jakerpomperada@aol.com
*/

#include <stdio.h>

int main() 
 int x=0, y=0; 
 printf("\n\n");
 printf("\tBitwise Operators Demonstration");
 printf("\n\n");
 printf("\tGive two integers: ");
 scanf("%d%d",&x,&y);
 printf("\n\n");
 printf("\t%d & %d =  %d\n",x,y,(x & y)); 
 printf("\t%d | %d = %d\n",x,y,(x | y)); 
 printf("\t%d ^ %d = %d\n",x,y,(x ^ y));
 printf("\t~%d = %d\n",x,~x); 
 printf("\t%d << %d = %d\n",x,2,(x << 2));
 printf("\t%d >> %d = %d\n",x,2,(x >> 2));
 printf("\n\n");
 printf("\tEnd of Program");
 printf("\n\n");
}