#include<stdio.h>
int main()
{
unsigned char a,b;
printf("Enter first number : ");
scanf("%d",&a);
printf("Enter 2nd number : ");
scanf("%d",&b);
printf("a&b = %d\n", a&b);
printf("a|b = %d\n", a|b);
printf("a^b = %d\n", a^b);
printf("~a = %d\n",a = ~a);
printf("b<<1 = %d\n", b<<1);
printf("b>>1 = %d\n", b>>1);
return 0;
}
i am taking input from user but i am getting wrong output how i modify i***
error
These calls of
scanfand
use an incorrect format specification.
The variables
aandbare declared as having the typeunsigned charIf you want to enter integers in these variables you need to write
and
So your program will look like
The program output might look like