#include<stdio.h>
int main()
{
int A[]={1, 5, 7, 10, 13};
int B[]={11, 15, 23, 30, 45};
int n=sizeof(A)/sizeof(int);
int n1=0,n2=0,k=0,i=0,j=0;
while(k<n+1){
if(A[i]<B[j]){
if(k==n-1){
n1=A[i];
}
if(k==n){
n2=A[i];
}
i++;
k++;
}
else{
if(k==n-1){
n1=B[j];
}
if(k==n){
n2=B[j];
}
j++;
k++;
}
}
printf("%d",(n1+n2)/2);
return 0;
}
Bitwise Operators : Bitwise Operators do not operate on decimal value of the Number. They first convert the numbers into binary value & then they operate on it. Bitwise opeartors are not used with floating type variables. Bitwise AND :- & Bitwise OR :- | Bitwise XOR :- ^ Bitwise NOT :- ~ LEFT SHIFT :- << RIGHT SHIFT :- >> Bitwise AND & Example : N1 = 10 , N2 = 15 N1 & N2 In Binary : 0 0 1 0 1 0 0 0 1 1 1 1 ...
Comments
Post a Comment