Program :
#include<stdio.h>
void main()
{
unsigned int x:1;
unsigned int y:1; /* because of this x and y will only take either 1 or 0 value*/
printf("Enter 1st binary number");
scanf("%u",&x);
printf("Enter 2nd binary number");
scanf("%u",&y);
x<=y ? printf("Answer of AND operation is %u",x) : printf("Answer of AND operation is %u",y);
}
#include<stdio.h>
void main()
{
unsigned int x:1;
unsigned int y:1; /* because of this x and y will only take either 1 or 0 value*/
printf("Enter 1st binary number");
scanf("%u",&x);
printf("Enter 2nd binary number");
scanf("%u",&y);
x<=y ? printf("Answer of AND operation is %u",x) : printf("Answer of AND operation is %u",y);
}
No comments:
Post a Comment