A simple program that demonstrate how to use and declare bitwise operators in C programming language.
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.
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 in C");
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");
}