30.12.20

C PROGRAM TO PERFORM ALL BITWISE OPERATORS AVAILABLE IN C

#include <stdio.h>

#include <stdlib.h>

 

 

int main()

{

 

int a,b;

int c=0;

printf("Enter a and b value ");

scanf("%d%d",&a,&b);

c=a&b;

printf("value of c is %d\n",c);

 

c=a|b;

printf("value of c is %d\n",c);

c=a^b;

printf("value of c is %d\n",c);

c=a<<2;

printf("value of c is %d\n",c);

c=a>>2;

printf("value of c is %d\n",c);

    return 0;

}

OUTPUT

Enter a and b value 60 13

Value of c is 12

Value of c is 61

Value of c is 49

Value of c is 240

Value of c is 15

No comments:

Post a Comment

JAVA program pattern 2

import java.util.Scanner; public class pattern3 { public static void main(String args[]) { int i,j; Scanner sc=new Scanner(System.in); Syste...